home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / misc / memtest8.000 / memtest8
Tape Archive  |  1996-05-29  |  50.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Tape Archive (archive/tar).

You can browse this item here: memtest8

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Tape Archive (archive/tar) magic Supported
100% file POSIX tar archive (GNU) default
99% file POSIX tar archive (GNU), directory memtest86/, mode 40755 , uid 20252 , gid 0 , size 0 , seconds 6152755526, user cbrady, group root default
98% file data default
62% TrID TAR - Tape ARchive (GNU) default
37% TrID TAR - Tape ARchive (directory) default
100% siegfried x-fmt/265 Tape Archive Format default
100% lsar Tar default
100% gt2 TAR Archiv gefunden (Auflistung ist deaktiviert) default
100% disktype GNU tar archive default
100% detectItEasy Archive: tar default
100% binwalkID POSIX tar archive (GNU), owner user name: "6/" default
100% xdgMime application/x-tar default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 6d 65 6d 74 65 73 74 38 | 36 2f 00 00 00 00 00 00 |memtest8|6/......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 34 30 37 | 35 35 20 00 20 32 30 32 |.... 407|55 . 202|
|00000070| 35 32 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |52 . | 0 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 36 31 35 32 37 35 35 | 0 | 6152755|
|00000090| 35 32 36 20 20 31 31 33 | 30 35 00 20 35 00 00 00 |526 113|05. 5...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 20 20 | 00 63 62 72 61 64 79 00 |.ustar |.cbrady.|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 6d 65 6d 74 65 73 74 38 | 36 2f 4d 61 6b 65 66 69 |memtest8|6/Makefi|
|00000210| 6c 65 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |le......|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 31 30 30 37 | 35 35 20 00 20 32 30 32 |....1007|55 . 202|
|00000270| 35 32 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |52 . | 0 . |
|00000280| 20 20 20 34 35 35 32 20 | 20 36 31 35 32 37 35 35 | 4552 | 6152755|
|00000290| 31 37 32 20 20 31 33 30 | 35 30 00 20 30 00 00 00 |172 130|50. 0...|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 75 73 74 61 72 20 20 | 00 63 62 72 61 64 79 00 |.ustar |.cbrady.|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 23 20 4d 61 6b 65 66 69 | 6c 65 20 66 6f 72 20 4d |# Makefi|le for M|
|00000410| 65 6d 54 65 73 74 2d 38 | 36 0a 23 0a 23 20 41 75 |emTest-8|6.#.# Au|
|00000420| 74 68 6f 72 3a 09 09 43 | 68 72 69 73 20 42 72 61 |thor:..C|hris Bra|
|00000430| 64 79 0a 23 20 43 72 65 | 61 74 65 64 3a 09 09 4a |dy.# Cre|ated:..J|
|00000440| 61 6e 75 61 72 79 20 31 | 2c 20 31 39 39 36 0a 23 |anuary 1|, 1996.#|
|00000450| 20 45 6e 68 61 6e 63 65 | 6d 65 6e 74 73 20 2d 20 | Enhance|ments - |
|00000460| 56 31 2e 31 3a 09 4d 61 | 79 20 32 38 2c 20 31 39 |V1.1:.Ma|y 28, 19|
|00000470| 39 36 0a 0a 23 0a 23 20 | 53 65 6c 65 63 74 20 4c |96..#.# |Select L|
|00000480| 69 6e 75 78 20 72 65 6c | 65 61 73 65 20 28 4d 75 |inux rel|ease (Mu|
|00000490| 73 74 20 62 65 20 73 65 | 74 20 66 6f 72 20 6c 6f |st be se|t for lo|
|000004a0| 61 64 65 72 20 63 6f 6d | 70 61 74 69 62 69 6c 69 |ader com|patibili|
|000004b0| 74 79 2e 20 4f 6e 6c 79 | 20 52 65 6c 65 61 73 65 |ty. Only| Release|
|000004c0| 73 0a 23 20 31 2e 32 20 | 61 6e 64 20 31 2e 33 20 |s.# 1.2 |and 1.3 |
|000004d0| 61 72 65 20 63 75 72 72 | 65 6e 74 6c 79 20 73 75 |are curr|ently su|
|000004e0| 70 70 6f 72 74 65 64 29 | 0a 23 0a 23 52 45 4c 5f |pported)|.#.#REL_|
|000004f0| 31 2e 32 3d 31 0a 52 45 | 4c 5f 31 2e 33 3d 31 0a |1.2=1.RE|L_1.3=1.|
|00000500| 0a 23 0a 23 20 50 61 74 | 68 20 66 6f 72 20 74 68 |.#.# Pat|h for th|
|00000510| 65 20 66 6c 6f 70 70 79 | 20 64 69 73 6b 20 64 65 |e floppy| disk de|
|00000520| 76 69 63 65 0a 23 0a 46 | 44 49 53 4b 3d 2f 64 65 |vice.#.F|DISK=/de|
|00000530| 76 2f 66 64 30 0a 0a 23 | 0a 23 20 43 6f 6d 6d 65 |v/fd0..#|.# Comme|
|00000540| 6e 74 20 6f 75 74 20 74 | 68 65 20 66 6f 6c 6c 6f |nt out t|he follo|
|00000550| 77 69 6e 67 20 74 6f 20 | 64 69 73 61 62 6c 65 20 |wing to |disable |
|00000560| 74 65 73 74 69 6e 67 20 | 77 69 74 68 6f 75 74 20 |testing |without |
|00000570| 63 61 63 68 65 0a 23 0a | 43 41 43 48 45 3d 2d 44 |cache.#.|CACHE=-D|
|00000580| 43 41 43 48 45 0a 0a 23 | 0a 23 20 43 6f 6d 6d 65 |CACHE..#|.# Comme|
|00000590| 6e 74 20 6f 75 74 20 74 | 68 65 20 66 6f 6c 6c 6f |nt out t|he follo|
|000005a0| 77 69 6e 67 20 74 6f 20 | 64 69 73 61 62 6c 65 20 |wing to |disable |
|000005b0| 74 65 73 74 69 6e 67 20 | 77 69 74 68 20 6c 6f 6e |testing |with lon|
|000005c0| 67 20 72 65 66 72 65 73 | 68 20 74 69 6d 69 6e 67 |g refres|h timing|
|000005d0| 0a 23 0a 52 45 46 52 45 | 53 48 3d 2d 44 52 45 46 |.#.REFRE|SH=-DREF|
|000005e0| 52 45 53 48 0a 0a 23 0a | 23 20 67 63 63 20 63 6f |RESH..#.|# gcc co|
|000005f0| 6d 70 69 6c 65 72 20 6f | 70 74 69 6f 6e 73 2c 20 |mpiler o|ptions, |
|00000600| 74 68 65 73 65 20 73 65 | 74 74 69 6e 67 73 20 73 |these se|ttings s|
|00000610| 68 6f 75 6c 64 20 73 75 | 66 66 69 63 65 0a 23 0a |hould su|ffice.#.|
|00000620| 43 43 46 4c 41 47 53 3d | 2d 6d 34 38 36 20 2d 4f |CCFLAGS=|-m486 -O|
|00000630| 32 0a 0a 61 6c 6c 3a 20 | 73 65 74 75 70 20 62 6f |2..all: |setup bo|
|00000640| 6f 74 73 65 63 74 20 68 | 65 61 64 20 62 75 69 6c |otsect h|ead buil|
|00000650| 64 0a 69 66 64 65 66 20 | 52 45 4c 5f 31 2e 33 0a |d.ifdef |REL_1.3.|
|00000660| 0a 09 6f 62 6a 64 75 6d | 70 20 2d 6b 20 2d 71 20 |..objdum|p -k -q |
|00000670| 2d 6f 20 30 78 30 31 30 | 30 20 68 65 61 64 20 3e |-o 0x010|0 head >|
|00000680| 68 65 61 64 2e 6f 75 74 | 0a 09 2e 2f 62 75 69 6c |head.out|.../buil|
|00000690| 64 20 62 6f 6f 74 73 65 | 63 74 20 73 65 74 75 70 |d bootse|ct setup|
|000006a0| 20 68 65 61 64 2e 6f 75 | 74 20 3e 69 6d 61 67 65 | head.ou|t >image|
|000006b0| 0a 65 6c 73 65 0a 09 2e | 2f 62 75 69 6c 64 20 62 |.else...|/build b|
|000006c0| 6f 6f 74 73 65 63 74 20 | 73 65 74 75 70 20 68 65 |ootsect |setup he|
|000006d0| 61 64 20 3e 69 6d 61 67 | 65 0a 65 6e 64 69 66 0a |ad >imag|e.endif.|
|000006e0| 0a 6d 74 65 73 74 2e 6f | 3a 20 6d 74 65 73 74 2e |.mtest.o|: mtest.|
|000006f0| 63 20 6d 74 65 73 74 2e | 68 0a 09 63 63 20 2d 63 |c mtest.|h..cc -c|
|00000700| 20 24 28 43 43 46 4c 41 | 47 53 29 20 24 28 52 45 | $(CCFLA|GS) $(RE|
|00000710| 46 52 45 53 48 29 20 24 | 28 43 41 43 48 45 29 20 |FRESH) $|(CACHE) |
|00000720| 6d 74 65 73 74 2e 63 0a | 0a 23 20 57 61 72 6e 69 |mtest.c.|.# Warni|
|00000730| 6e 67 20 2d 20 52 65 61 | 64 20 74 68 65 20 66 6f |ng - Rea|d the fo|
|00000740| 6c 6c 6f 77 69 6e 67 20 | 63 61 72 65 66 75 6c 6c |llowing |carefull|
|00000750| 79 20 69 66 20 79 6f 75 | 20 6d 6f 64 69 66 79 20 |y if you| modify |
|00000760| 74 68 65 20 63 6f 64 65 | 20 69 6e 20 61 6e 79 20 |the code| in any |
|00000770| 77 61 79 21 0a 23 0a 23 | 20 54 68 65 20 22 2d 54 |way!.#.#| The "-T|
|00000780| 74 65 78 74 22 20 6f 70 | 74 69 6f 6e 20 66 6f 72 |text" op|tion for|
|00000790| 20 6c 64 20 73 65 74 73 | 20 74 68 65 20 6f 72 69 | ld sets| the ori|
|000007a0| 67 69 6e 20 66 6f 72 20 | 74 68 65 20 74 65 78 74 |gin for |the text|
|000007b0| 20 73 65 67 6d 65 6e 74 | 2e 20 54 68 69 73 0a 23 | segment|. This.#|
|000007c0| 20 6d 75 73 74 20 6d 61 | 74 63 68 20 74 68 65 20 | must ma|tch the |
|000007d0| 61 64 72 73 20 77 68 65 | 72 65 20 74 68 65 20 63 |adrs whe|re the c|
|000007e0| 6f 64 65 20 77 69 6c 6c | 20 65 78 65 63 75 74 65 |ode will| execute|
|000007f0| 20 28 54 45 53 54 41 44 | 52 20 69 6e 20 6d 74 65 | (TESTAD|R in mte|
|00000800| 73 74 2e 68 29 2e 20 0a | 23 20 48 6f 77 65 76 65 |st.h). .|# Howeve|
|00000810| 72 2c 20 69 6e 20 4c 69 | 6e 75 78 20 31 2e 32 20 |r, in Li|nux 1.2 |
|00000820| 6c 64 20 69 6e 74 72 6f | 64 75 63 65 73 20 61 6e |ld intro|duces an|
|00000830| 20 6f 66 66 73 65 74 20 | 6f 66 20 30 78 32 30 20 | offset |of 0x20 |
|00000840| 73 6f 20 74 68 65 0a 23 | 20 73 70 65 63 69 66 69 |so the.#| specifi|
|00000850| 65 64 20 61 64 64 72 65 | 73 73 20 6d 75 73 74 20 |ed addre|ss must |
|00000860| 62 65 20 73 65 74 20 74 | 6f 20 54 45 53 54 41 44 |be set t|o TESTAD|
|00000870| 52 20 2d 20 30 78 32 30 | 2e 20 55 67 6c 79 21 21 |R - 0x20|. Ugly!!|
|00000880| 0a 23 0a 23 20 54 68 65 | 20 22 2d 54 64 61 74 61 |.#.# The| "-Tdata|
|00000890| 22 20 6f 70 74 69 6f 6e | 20 66 6f 72 20 6c 64 20 |" option| for ld |
|000008a0| 73 65 74 73 20 74 68 65 | 20 6f 72 69 67 69 6e 20 |sets the| origin |
|000008b0| 66 6f 72 20 74 68 65 20 | 64 61 74 61 20 73 65 67 |for the |data seg|
|000008c0| 6d 65 6e 74 2e 20 54 68 | 69 73 20 69 73 0a 23 20 |ment. Th|is is.# |
|000008d0| 69 73 20 73 65 74 20 62 | 79 20 68 61 6e 64 20 61 |is set b|y hand a|
|000008e0| 6e 64 20 77 69 6c 6c 20 | 6e 65 65 64 20 74 6f 20 |nd will |need to |
|000008f0| 62 65 20 61 64 6a 75 73 | 74 65 64 20 69 66 20 74 |be adjus|ted if t|
|00000900| 68 65 20 63 6f 64 65 20 | 67 72 6f 77 73 20 6d 75 |he code |grows mu|
|00000910| 63 68 20 61 74 20 61 6c | 6c 2e 0a 23 20 54 68 65 |ch at al|l..# The|
|00000920| 20 63 75 72 72 65 6e 74 | 20 73 65 74 74 69 6e 67 | current| setting|
|00000930| 73 20 6c 65 61 76 65 20 | 6f 6e 6c 79 20 61 20 73 |s leave |only a s|
|00000940| 6d 61 6c 6c 20 61 6d 6f | 75 6e 74 20 6f 66 20 72 |mall amo|unt of r|
|00000950| 6f 6f 6d 20 66 6f 72 20 | 67 72 6f 77 74 68 2e 20 |oom for |growth. |
|00000960| 4c 6f 6f 6b 20 61 74 0a | 23 20 74 68 65 20 6c 6f |Look at.|# the lo|
|00000970| 61 64 65 72 20 6d 61 70 | 20 74 6f 20 63 68 65 63 |ader map| to chec|
|00000980| 6b 20 74 68 69 73 20 61 | 64 64 72 65 73 73 2e 20 |k this a|ddress. |
|00000990| 20 49 6e 20 61 64 64 69 | 74 69 6f 6e 20 79 6f 75 | In addi|tion you|
|000009a0| 20 6d 61 79 20 6e 65 65 | 64 20 74 6f 20 61 64 6a | may nee|d to adj|
|000009b0| 75 73 74 0a 23 20 74 68 | 65 20 73 74 61 72 74 69 |ust.# th|e starti|
|000009c0| 6e 67 20 74 65 73 74 20 | 61 64 64 72 65 73 73 20 |ng test |address |
|000009d0| 28 53 54 41 52 54 5f 41 | 44 52 20 69 6e 20 6d 74 |(START_A|DR in mt|
|000009e0| 65 73 74 2e 68 29 20 74 | 6f 20 74 68 65 20 65 6e |est.h) t|o the en|
|000009f0| 64 20 61 64 64 72 65 73 | 73 20 6f 66 20 74 68 65 |d addres|s of the|
|00000a00| 0a 23 20 74 65 73 74 20 | 2b 20 7e 30 78 32 30 2e |.# test |+ ~0x20.|
|00000a10| 20 20 41 67 61 69 6e 20 | 63 6f 6e 73 75 6c 74 20 | Again |consult |
|00000a20| 74 68 65 20 6c 6f 61 64 | 65 72 20 6d 61 70 2e 0a |the load|er map..|
|00000a30| 23 0a 68 65 61 64 3a 20 | 68 65 61 64 2e 6f 20 6d |#.head: |head.o m|
|00000a40| 74 65 73 74 2e 6f 0a 69 | 66 64 65 66 20 52 45 4c |test.o.i|fdef REL|
|00000a50| 5f 31 2e 33 0a 09 6c 64 | 20 2d 6d 20 65 6c 66 5f |_1.3..ld| -m elf_|
|00000a60| 69 33 38 36 20 2d 6f 20 | 24 40 20 2d 65 20 64 6f |i386 -o |$@ -e do|
|00000a70| 5f 74 65 73 74 20 2d 54 | 74 65 78 74 20 30 78 30 |_test -T|text 0x0|
|00000a80| 31 30 30 20 2d 54 64 61 | 74 61 20 30 78 30 63 63 |100 -Tda|ta 0x0cc|
|00000a90| 30 20 2d 4d 61 70 20 6d | 61 70 66 69 6c 65 20 68 |0 -Map m|apfile h|
|00000aa0| 65 61 64 2e 6f 20 6d 74 | 65 73 74 2e 6f 0a 65 6c |ead.o mt|est.o.el|
|00000ab0| 73 65 0a 09 6c 64 20 2d | 6f 20 24 40 20 20 2d 71 |se..ld -|o $@ -q|
|00000ac0| 6d 61 67 69 63 20 2d 4d | 61 70 20 6d 61 70 66 69 |magic -M|ap mapfi|
|00000ad0| 6c 65 20 2d 54 74 65 78 | 74 20 30 78 30 30 65 30 |le -Ttex|t 0x00e0|
|00000ae0| 20 2d 54 64 61 74 61 20 | 30 78 30 63 63 30 20 68 | -Tdata |0x0cc0 h|
|00000af0| 65 61 64 2e 6f 20 6d 74 | 65 73 74 2e 6f 0a 65 6e |ead.o mt|est.o.en|
|00000b00| 64 69 66 0a 0a 68 65 61 | 64 2e 6f 3a 20 68 65 61 |dif..hea|d.o: hea|
|00000b10| 64 2e 73 0a 09 61 73 20 | 2d 6f 20 24 40 20 24 3c |d.s..as |-o $@ $<|
|00000b20| 0a 0a 68 65 61 64 2e 73 | 3a 20 68 65 61 64 2e 53 |..head.s|: head.S|
|00000b30| 20 6d 74 65 73 74 2e 68 | 0a 09 63 63 20 2d 45 20 | mtest.h|..cc -E |
|00000b40| 2d 74 72 61 64 69 74 69 | 6f 6e 61 6c 20 24 3c 20 |-traditi|onal $< |
|00000b50| 2d 6f 20 24 40 0a 0a 73 | 65 74 75 70 3a 20 73 65 |-o $@..s|etup: se|
|00000b60| 74 75 70 2e 6f 0a 09 6c | 64 38 36 20 2d 30 20 2d |tup.o..l|d86 -0 -|
|00000b70| 73 20 2d 6f 20 24 40 20 | 24 3c 0a 0a 73 65 74 75 |s -o $@ |$<..setu|
|00000b80| 70 2e 6f 3a 20 73 65 74 | 75 70 2e 73 0a 09 61 73 |p.o: set|up.s..as|
|00000b90| 38 36 20 2d 61 20 2d 30 | 20 2d 6f 20 24 40 20 24 |86 -a -0| -o $@ $|
|00000ba0| 3c 0a 0a 73 65 74 75 70 | 2e 73 3a 20 73 65 74 75 |<..setup|.s: setu|
|00000bb0| 70 2e 53 20 6d 74 65 73 | 74 2e 68 0a 09 63 63 20 |p.S mtes|t.h..cc |
|00000bc0| 2d 45 20 2d 74 72 61 64 | 69 74 69 6f 6e 61 6c 20 |-E -trad|itional |
|00000bd0| 24 3c 20 2d 6f 20 24 40 | 0a 0a 62 6f 6f 74 73 65 |$< -o $@|..bootse|
|00000be0| 63 74 3a 20 62 6f 6f 74 | 73 65 63 74 2e 6f 0a 09 |ct: boot|sect.o..|
|00000bf0| 6c 64 38 36 20 2d 30 20 | 2d 73 20 2d 6f 20 24 40 |ld86 -0 |-s -o $@|
|00000c00| 20 24 3c 0a 0a 62 6f 6f | 74 73 65 63 74 2e 6f 3a | $<..boo|tsect.o:|
|00000c10| 20 62 6f 6f 74 73 65 63 | 74 2e 73 0a 09 61 73 38 | bootsec|t.s..as8|
|00000c20| 36 20 2d 61 20 2d 30 20 | 2d 6f 20 24 40 20 24 3c |6 -a -0 |-o $@ $<|
|00000c30| 0a 0a 62 6f 6f 74 73 65 | 63 74 2e 73 3a 20 62 6f |..bootse|ct.s: bo|
|00000c40| 6f 74 73 65 63 74 2e 53 | 20 6d 74 65 73 74 2e 68 |otsect.S| mtest.h|
|00000c50| 0a 09 63 63 20 2d 45 20 | 2d 74 72 61 64 69 74 69 |..cc -E |-traditi|
|00000c60| 6f 6e 61 6c 20 24 3c 20 | 2d 6f 20 24 40 0a 0a 62 |onal $< |-o $@..b|
|00000c70| 75 69 6c 64 3a 09 62 75 | 69 6c 64 2e 63 0a 69 66 |uild:.bu|ild.c.if|
|00000c80| 64 65 66 20 52 45 4c 5f | 31 2e 33 0a 09 63 63 20 |def REL_|1.3..cc |
|00000c90| 2d 44 45 4c 46 20 2d 6f | 20 62 75 69 6c 64 20 62 |-DELF -o| build b|
|00000ca0| 75 69 6c 64 2e 63 0a 65 | 6c 73 65 0a 09 63 63 20 |uild.c.e|lse..cc |
|00000cb0| 2d 6f 20 62 75 69 6c 64 | 20 62 75 69 6c 64 2e 63 |-o build| build.c|
|00000cc0| 0a 65 6e 64 69 66 0a 0a | 63 6c 65 61 6e 3a 0a 09 |.endif..|clean:..|
|00000cd0| 72 6d 20 2d 66 20 2a 2e | 6f 20 2a 2e 73 20 62 75 |rm -f *.|o *.s bu|
|00000ce0| 69 6c 64 20 69 6d 61 67 | 65 20 62 6f 6f 74 73 65 |ild imag|e bootse|
|00000cf0| 63 74 20 73 65 74 75 70 | 20 68 65 61 64 20 68 65 |ct setup| head he|
|00000d00| 61 64 2e 6f 75 74 20 6d | 61 70 66 69 6c 65 0a 0a |ad.out m|apfile..|
|00000d10| 69 6e 73 74 61 6c 6c 3a | 20 61 6c 6c 0a 09 64 64 |install:| all..dd|
|00000d20| 20 3c 69 6d 61 67 65 20 | 3e 24 28 46 44 49 53 4b | <image |>$(FDISK|
|00000d30| 29 20 62 73 3d 38 31 39 | 32 0a 0a 69 6e 73 74 61 |) bs=819|2..insta|
|00000d40| 6c 6c 2d 62 69 6e 3a 0a | 09 64 64 20 3c 69 6d 61 |ll-bin:.|.dd <ima|
|00000d50| 67 65 2e 62 69 6e 20 3e | 24 28 46 44 49 53 4b 29 |ge.bin >|$(FDISK)|
|00000d60| 20 62 73 3d 38 31 39 32 | 0a 0a 00 00 00 00 00 00 | bs=8192|........|
|00000d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e00| 6d 65 6d 74 65 73 74 38 | 36 2f 62 6f 6f 74 73 65 |memtest8|6/bootse|
|00000e10| 63 74 2e 53 00 00 00 00 | 00 00 00 00 00 00 00 00 |ct.S....|........|
|00000e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e60| 00 00 00 00 31 30 30 37 | 35 35 20 00 20 32 30 32 |....1007|55 . 202|
|00000e70| 35 32 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |52 . | 0 . |
|00000e80| 20 20 31 37 33 31 37 20 | 20 36 30 37 32 30 31 37 | 17317 | 6072017|
|00000e90| 31 32 30 20 20 31 33 33 | 36 32 00 20 30 00 00 00 |120 133|62. 0...|
|00000ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f00| 00 75 73 74 61 72 20 20 | 00 63 62 72 61 64 79 00 |.ustar |.cbrady.|
|00000f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f20| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00000f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001000| 21 0a 21 09 62 6f 6f 74 | 73 65 63 74 2e 73 09 09 |!.!.boot|sect.s..|
|00001010| 43 6f 70 79 72 69 67 68 | 74 20 28 43 29 20 31 39 |Copyrigh|t (C) 19|
|00001020| 39 31 2c 20 31 39 39 32 | 20 4c 69 6e 75 73 20 54 |91, 1992| Linus T|
|00001030| 6f 72 76 61 6c 64 73 0a | 21 0a 21 20 62 6f 6f 74 |orvalds.|!.! boot|
|00001040| 73 65 63 74 2e 73 20 69 | 73 20 6c 6f 61 64 65 64 |sect.s i|s loaded|
|00001050| 20 61 74 20 30 78 37 63 | 30 30 20 62 79 20 74 68 | at 0x7c|00 by th|
|00001060| 65 20 62 69 6f 73 2d 73 | 74 61 72 74 75 70 20 72 |e bios-s|tartup r|
|00001070| 6f 75 74 69 6e 65 73 2c | 20 61 6e 64 20 6d 6f 76 |outines,| and mov|
|00001080| 65 73 0a 21 20 69 74 73 | 65 6c 66 20 6f 75 74 20 |es.! its|elf out |
|00001090| 6f 66 20 74 68 65 20 77 | 61 79 20 74 6f 20 61 64 |of the w|ay to ad|
|000010a0| 64 72 65 73 73 20 30 78 | 39 30 30 30 30 2c 20 61 |dress 0x|90000, a|
|000010b0| 6e 64 20 6a 75 6d 70 73 | 20 74 68 65 72 65 2e 0a |nd jumps| there..|
|000010c0| 21 0a 21 20 49 74 20 74 | 68 65 6e 20 6c 6f 61 64 |!.! It t|hen load|
|000010d0| 73 20 27 73 65 74 75 70 | 27 20 64 69 72 65 63 74 |s 'setup|' direct|
|000010e0| 6c 79 20 61 66 74 65 72 | 20 69 74 73 65 6c 66 20 |ly after| itself |
|000010f0| 28 30 78 39 30 32 30 30 | 29 2c 20 61 6e 64 20 74 |(0x90200|), and t|
|00001100| 68 65 20 73 79 73 74 65 | 6d 0a 21 20 61 74 20 30 |he syste|m.! at 0|
|00001110| 78 31 30 30 30 30 2c 20 | 75 73 69 6e 67 20 42 49 |x10000, |using BI|
|00001120| 4f 53 20 69 6e 74 65 72 | 72 75 70 74 73 2e 20 0a |OS inter|rupts. .|
|00001130| 21 0a 21 20 54 68 65 20 | 6c 6f 61 64 65 72 20 68 |!.! The |loader h|
|00001140| 61 73 20 62 65 65 6e 20 | 6d 61 64 65 20 61 73 20 |as been |made as |
|00001150| 73 69 6d 70 6c 65 20 61 | 73 20 70 6f 73 73 69 62 |simple a|s possib|
|00001160| 6c 65 2c 20 61 6e 64 20 | 63 6f 6e 74 69 6e 75 6f |le, and |continuo|
|00001170| 73 0a 21 20 72 65 61 64 | 20 65 72 72 6f 72 73 20 |s.! read| errors |
|00001180| 77 69 6c 6c 20 72 65 73 | 75 6c 74 20 69 6e 20 61 |will res|ult in a|
|00001190| 20 75 6e 62 72 65 61 6b | 61 62 6c 65 20 6c 6f 6f | unbreak|able loo|
|000011a0| 70 2e 20 52 65 62 6f 6f | 74 20 62 79 20 68 61 6e |p. Reboo|t by han|
|000011b0| 64 2e 20 49 74 0a 21 20 | 6c 6f 61 64 73 20 70 72 |d. It.! |loads pr|
|000011c0| 65 74 74 79 20 66 61 73 | 74 20 62 79 20 67 65 74 |etty fas|t by get|
|000011d0| 74 69 6e 67 20 77 68 6f | 6c 65 20 74 72 61 63 6b |ting who|le track|
|000011e0| 73 20 61 74 20 61 20 74 | 69 6d 65 20 77 68 65 6e |s at a t|ime when|
|000011f0| 65 76 65 72 20 70 6f 73 | 73 69 62 6c 65 2e 0a 0a |ever pos|sible...|
|00001200| 21 20 31 2d 4a 61 6e 2d | 39 36 20 4d 6f 64 69 66 |! 1-Jan-|96 Modif|
|00001210| 69 65 64 20 62 79 20 43 | 68 72 69 73 20 42 72 61 |ied by C|hris Bra|
|00001220| 64 79 20 66 6f 72 20 75 | 73 65 20 61 73 20 61 20 |dy for u|se as a |
|00001230| 62 6f 6f 74 20 6c 6f 61 | 64 65 72 20 66 6f 72 20 |boot loa|der for |
|00001240| 4d 65 6d 54 65 73 74 2d | 38 36 2e 0a 0a 23 69 6e |MemTest-|86...#in|
|00001250| 63 6c 75 64 65 20 22 6d | 74 65 73 74 2e 68 22 0a |clude "m|test.h".|
|00001260| 0a 2e 74 65 78 74 0a 0a | 52 4f 4f 54 5f 44 45 56 |..text..|ROOT_DEV|
|00001270| 20 3d 20 30 0a 0a 21 20 | 6c 64 38 36 20 72 65 71 | = 0..! |ld86 req|
|00001280| 75 69 72 65 73 20 61 6e | 20 65 6e 74 72 79 20 73 |uires an| entry s|
|00001290| 79 6d 62 6f 6c 2e 20 54 | 68 69 73 20 6d 61 79 20 |ymbol. T|his may |
|000012a0| 61 73 20 77 65 6c 6c 20 | 62 65 20 74 68 65 20 75 |as well |be the u|
|000012b0| 73 75 61 6c 20 6f 6e 65 | 2e 0a 2e 67 6c 6f 62 6c |sual one|...globl|
|000012c0| 09 5f 6d 61 69 6e 0a 5f | 6d 61 69 6e 3a 0a 09 6d |._main._|main:..m|
|000012d0| 6f 76 09 61 78 2c 23 42 | 4f 4f 54 53 45 47 0a 09 |ov.ax,#B|OOTSEG..|
|000012e0| 6d 6f 76 09 64 73 2c 61 | 78 0a 09 6d 6f 76 09 61 |mov.ds,a|x..mov.a|
|000012f0| 78 2c 23 49 4e 49 54 53 | 45 47 0a 09 6d 6f 76 09 |x,#INITS|EG..mov.|
|00001300| 65 73 2c 61 78 0a 09 6d | 6f 76 09 63 78 2c 23 32 |es,ax..m|ov.cx,#2|
|00001310| 35 36 0a 09 73 75 62 09 | 73 69 2c 73 69 0a 09 73 |56..sub.|si,si..s|
|00001320| 75 62 09 64 69 2c 64 69 | 0a 09 63 6c 64 0a 09 72 |ub.di,di|..cld..r|
|00001330| 65 70 0a 09 6d 6f 76 73 | 77 0a 09 6a 6d 70 69 09 |ep..movs|w..jmpi.|
|00001340| 67 6f 2c 49 4e 49 54 53 | 45 47 0a 0a 67 6f 3a 09 |go,INITS|EG..go:.|
|00001350| 6d 6f 76 09 61 78 2c 63 | 73 09 09 0a 09 6d 6f 76 |mov.ax,c|s....mov|
|00001360| 09 64 78 2c 23 30 78 34 | 30 30 30 2d 31 32 09 21 |.dx,#0x4|000-12.!|
|00001370| 20 30 78 34 30 30 30 20 | 69 73 20 61 72 62 69 74 | 0x4000 |is arbit|
|00001380| 72 61 72 79 20 76 61 6c | 75 65 20 3e 3d 20 6c 65 |rary val|ue >= le|
|00001390| 6e 67 74 68 20 6f 66 0a | 09 09 09 09 21 20 62 6f |ngth of.|....! bo|
|000013a0| 6f 74 73 65 63 74 20 2b | 20 6c 65 6e 67 74 68 20 |otsect +| length |
|000013b0| 6f 66 20 73 65 74 75 70 | 20 2b 20 72 6f 6f 6d 20 |of setup| + room |
|000013c0| 66 6f 72 20 73 74 61 63 | 6b 0a 09 09 09 09 21 20 |for stac|k.....! |
|000013d0| 31 32 20 69 73 20 64 69 | 73 6b 20 70 61 72 6d 20 |12 is di|sk parm |
|000013e0| 73 69 7a 65 0a 0a 21 20 | 62 64 65 20 2d 20 63 68 |size..! |bde - ch|
|000013f0| 61 6e 67 65 64 20 30 78 | 66 66 30 30 20 74 6f 20 |anged 0x|ff00 to |
|00001400| 30 78 34 30 30 30 20 74 | 6f 20 75 73 65 20 64 65 |0x4000 t|o use de|
|00001410| 62 75 67 67 65 72 20 61 | 74 20 30 78 36 34 30 30 |bugger a|t 0x6400|
|00001420| 20 75 70 20 28 62 64 65 | 29 2e 20 20 57 65 0a 21 | up (bde|). We.!|
|00001430| 20 77 6f 75 6c 64 6e 27 | 74 20 68 61 76 65 20 74 | wouldn'|t have t|
|00001440| 6f 20 77 6f 72 72 79 20 | 61 62 6f 75 74 20 74 68 |o worry |about th|
|00001450| 69 73 20 69 66 20 77 65 | 20 63 68 65 63 6b 65 64 |is if we| checked|
|00001460| 20 74 68 65 20 74 6f 70 | 20 6f 66 20 6d 65 6d 6f | the top| of memo|
|00001470| 72 79 2e 20 20 41 6c 73 | 6f 0a 21 20 6d 79 20 42 |ry. Als|o.! my B|
|00001480| 49 4f 53 20 63 61 6e 20 | 62 65 20 63 6f 6e 66 69 |IOS can |be confi|
|00001490| 67 75 72 65 64 20 74 6f | 20 70 75 74 20 74 68 65 |gured to| put the|
|000014a0| 20 77 69 6e 69 20 64 72 | 69 76 65 20 74 61 62 6c | wini dr|ive tabl|
|000014b0| 65 73 20 69 6e 20 68 69 | 67 68 20 6d 65 6d 6f 72 |es in hi|gh memor|
|000014c0| 79 0a 21 20 69 6e 73 74 | 65 61 64 20 6f 66 20 69 |y.! inst|ead of i|
|000014d0| 6e 20 74 68 65 20 76 65 | 63 74 6f 72 20 74 61 62 |n the ve|ctor tab|
|000014e0| 6c 65 2e 20 20 54 68 65 | 20 6f 6c 64 20 73 74 61 |le. The| old sta|
|000014f0| 63 6b 20 6d 69 67 68 74 | 20 68 61 76 65 20 63 6c |ck might| have cl|
|00001500| 6f 62 62 65 72 65 64 20 | 74 68 65 0a 21 20 64 72 |obbered |the.! dr|
|00001510| 69 76 65 20 74 61 62 6c | 65 2e 0a 0a 09 6d 6f 76 |ive tabl|e....mov|
|00001520| 09 64 73 2c 61 78 0a 09 | 6d 6f 76 09 65 73 2c 61 |.ds,ax..|mov.es,a|
|00001530| 78 0a 09 6d 6f 76 09 73 | 73 2c 61 78 09 09 21 20 |x..mov.s|s,ax..! |
|00001540| 70 75 74 20 73 74 61 63 | 6b 20 61 74 20 49 4e 49 |put stac|k at INI|
|00001550| 54 53 45 47 3a 30 78 34 | 30 30 30 2d 31 32 2e 0a |TSEG:0x4|000-12..|
|00001560| 09 6d 6f 76 09 73 70 2c | 64 78 0a 2f 2a 0a 20 2a |.mov.sp,|dx./*. *|
|00001570| 09 4d 61 6e 79 20 42 49 | 4f 53 27 73 20 64 65 66 |.Many BI|OS's def|
|00001580| 61 75 6c 74 20 64 69 73 | 6b 20 70 61 72 61 6d 65 |ault dis|k parame|
|00001590| 74 65 72 20 74 61 62 6c | 65 73 20 77 69 6c 6c 20 |ter tabl|es will |
|000015a0| 6e 6f 74 20 0a 20 2a 09 | 72 65 63 6f 67 6e 69 7a |not . *.|recogniz|
|000015b0| 65 20 6d 75 6c 74 69 2d | 73 65 63 74 6f 72 20 72 |e multi-|sector r|
|000015c0| 65 61 64 73 20 62 65 79 | 6f 6e 64 20 74 68 65 20 |eads bey|ond the |
|000015d0| 6d 61 78 69 6d 75 6d 20 | 73 65 63 74 6f 72 20 6e |maximum |sector n|
|000015e0| 75 6d 62 65 72 0a 20 2a | 09 73 70 65 63 69 66 69 |umber. *|.specifi|
|000015f0| 65 64 20 69 6e 20 74 68 | 65 20 64 65 66 61 75 6c |ed in th|e defaul|
|00001600| 74 20 64 69 73 6b 65 74 | 74 65 20 70 61 72 61 6d |t disket|te param|
|00001610| 65 74 65 72 20 74 61 62 | 6c 65 73 20 2d 20 74 68 |eter tab|les - th|
|00001620| 69 73 20 6d 61 79 0a 20 | 2a 09 6d 65 61 6e 20 37 |is may. |*.mean 7|
|00001630| 20 73 65 63 74 6f 72 73 | 20 69 6e 20 73 6f 6d 65 | sectors| in some|
|00001640| 20 63 61 73 65 73 2e 0a | 20 2a 0a 20 2a 09 53 69 | cases..| *. *.Si|
|00001650| 6e 63 65 20 73 69 6e 67 | 6c 65 20 73 65 63 74 6f |nce sing|le secto|
|00001660| 72 20 72 65 61 64 73 20 | 61 72 65 20 73 6c 6f 77 |r reads |are slow|
|00001670| 20 61 6e 64 20 6f 75 74 | 20 6f 66 20 74 68 65 20 | and out| of the |
|00001680| 71 75 65 73 74 69 6f 6e | 2c 0a 20 2a 09 77 65 20 |question|,. *.we |
|00001690| 6d 75 73 74 20 74 61 6b | 65 20 63 61 72 65 20 6f |must tak|e care o|
|000016a0| 66 20 74 68 69 73 20 62 | 79 20 63 72 65 61 74 69 |f this b|y creati|
|000016b0| 6e 67 20 6e 65 77 20 70 | 61 72 61 6d 65 74 65 72 |ng new p|arameter|
|000016c0| 20 74 61 62 6c 65 73 0a | 20 2a 09 28 66 6f 72 20 | tables.| *.(for |
|000016d0| 74 68 65 20 66 69 72 73 | 74 20 64 69 73 6b 29 20 |the firs|t disk) |
|000016e0| 69 6e 20 52 41 4d 2e 20 | 20 57 65 20 77 69 6c 6c |in RAM. | We will|
|000016f0| 20 73 65 74 20 74 68 65 | 20 6d 61 78 69 6d 75 6d | set the| maximum|
|00001700| 20 73 65 63 74 6f 72 0a | 20 2a 09 63 6f 75 6e 74 | sector.| *.count|
|00001710| 20 74 6f 20 31 38 20 2d | 20 74 68 65 20 6d 6f 73 | to 18 -| the mos|
|00001720| 74 20 77 65 20 77 69 6c | 6c 20 65 6e 63 6f 75 6e |t we wil|l encoun|
|00001730| 74 65 72 20 6f 6e 20 61 | 6e 20 48 44 20 31 2e 34 |ter on a|n HD 1.4|
|00001740| 34 2e 20 20 0a 20 2a 0a | 20 2a 09 48 69 67 68 20 |4. . *.| *.High |
|00001750| 64 6f 65 73 6e 27 74 20 | 68 75 72 74 2e 20 20 4c |doesn't |hurt. L|
|00001760| 6f 77 20 64 6f 65 73 2e | 0a 20 2a 0a 20 2a 09 53 |ow does.|. *. *.S|
|00001770| 65 67 6d 65 6e 74 73 20 | 61 72 65 20 61 73 20 66 |egments |are as f|
|00001780| 6f 6c 6c 6f 77 73 3a 20 | 64 73 3d 65 73 3d 73 73 |ollows: |ds=es=ss|
|00001790| 3d 63 73 20 2d 20 49 4e | 49 54 53 45 47 2c 0a 20 |=cs - IN|ITSEG,. |
|000017a0| 2a 09 09 66 73 20 3d 20 | 30 2c 20 67 73 20 3d 20 |*..fs = |0, gs = |
|000017b0| 70 61 72 61 6d 65 74 65 | 72 20 74 61 62 6c 65 20 |paramete|r table |
|000017c0| 73 65 67 6d 65 6e 74 0a | 20 2a 2f 0a 0a 09 70 75 |segment.| */...pu|
|000017d0| 73 68 09 23 30 0a 09 70 | 6f 70 09 66 73 0a 09 6d |sh.#0..p|op.fs..m|
|000017e0| 6f 76 09 62 78 2c 23 30 | 78 37 38 09 09 21 20 66 |ov.bx,#0|x78..! f|
|000017f0| 73 3a 62 78 20 69 73 20 | 70 61 72 61 6d 65 74 65 |s:bx is |paramete|
|00001800| 72 20 74 61 62 6c 65 20 | 61 64 64 72 65 73 73 0a |r table |address.|
|00001810| 09 73 65 67 20 66 73 0a | 09 6c 67 73 09 73 69 2c |.seg fs.|.lgs.si,|
|00001820| 28 62 78 29 09 09 09 21 | 20 67 73 3a 73 69 20 69 |(bx)...!| gs:si i|
|00001830| 73 20 73 6f 75 72 63 65 | 0a 0a 09 6d 6f 76 09 64 |s source|...mov.d|
|00001840| 69 2c 64 78 09 09 09 21 | 20 65 73 3a 64 69 20 69 |i,dx...!| es:di i|
|00001850| 73 20 64 65 73 74 69 6e | 61 74 69 6f 6e 0a 09 6d |s destin|ation..m|
|00001860| 6f 76 09 63 78 2c 23 36 | 09 09 09 21 20 63 6f 70 |ov.cx,#6|...! cop|
|00001870| 79 20 31 32 20 62 79 74 | 65 73 0a 09 63 6c 64 0a |y 12 byt|es..cld.|
|00001880| 0a 09 72 65 70 0a 09 73 | 65 67 20 67 73 0a 09 6d |..rep..s|eg gs..m|
|00001890| 6f 76 73 77 0a 0a 09 6d | 6f 76 09 64 69 2c 64 78 |ovsw...m|ov.di,dx|
|000018a0| 0a 09 6d 6f 76 62 09 34 | 28 64 69 29 2c 2a 31 38 |..movb.4|(di),*18|
|000018b0| 09 09 21 20 70 61 74 63 | 68 20 73 65 63 74 6f 72 |..! patc|h sector|
|000018c0| 20 63 6f 75 6e 74 0a 0a | 09 73 65 67 20 66 73 0a | count..|.seg fs.|
|000018d0| 09 6d 6f 76 09 28 62 78 | 29 2c 64 69 0a 09 73 65 |.mov.(bx|),di..se|
|000018e0| 67 20 66 73 0a 09 6d 6f | 76 09 32 28 62 78 29 2c |g fs..mo|v.2(bx),|
|000018f0| 65 73 0a 0a 09 6d 6f 76 | 09 61 78 2c 63 73 0a 09 |es...mov|.ax,cs..|
|00001900| 6d 6f 76 09 66 73 2c 61 | 78 0a 09 6d 6f 76 09 67 |mov.fs,a|x..mov.g|
|00001910| 73 2c 61 78 0a 09 0a 09 | 78 6f 72 09 61 68 2c 61 |s,ax....|xor.ah,a|
|00001920| 68 09 09 09 21 20 72 65 | 73 65 74 20 46 44 43 20 |h...! re|set FDC |
|00001930| 0a 09 78 6f 72 09 64 6c | 2c 64 6c 0a 09 69 6e 74 |..xor.dl|,dl..int|
|00001940| 20 09 30 78 31 33 09 0a | 0a 21 20 6c 6f 61 64 20 | .0x13..|.! load |
|00001950| 74 68 65 20 73 65 74 75 | 70 2d 73 65 63 74 6f 72 |the setu|p-sector|
|00001960| 73 20 64 69 72 65 63 74 | 6c 79 20 61 66 74 65 72 |s direct|ly after|
|00001970| 20 74 68 65 20 62 6f 6f | 74 62 6c 6f 63 6b 2e 0a | the boo|tblock..|
|00001980| 21 20 4e 6f 74 65 20 74 | 68 61 74 20 27 65 73 27 |! Note t|hat 'es'|
|00001990| 20 69 73 20 61 6c 72 65 | 61 64 79 20 73 65 74 20 | is alre|ady set |
|000019a0| 75 70 2e 0a 0a 6c 6f 61 | 64 5f 73 65 74 75 70 3a |up...loa|d_setup:|
|000019b0| 0a 09 78 6f 72 09 64 78 | 2c 20 64 78 09 09 09 21 |..xor.dx|, dx...!|
|000019c0| 20 64 72 69 76 65 20 30 | 2c 20 68 65 61 64 20 30 | drive 0|, head 0|
|000019d0| 0a 09 6d 6f 76 09 63 78 | 2c 23 30 78 30 30 30 32 |..mov.cx|,#0x0002|
|000019e0| 09 09 21 20 73 65 63 74 | 6f 72 20 32 2c 20 74 72 |..! sect|or 2, tr|
|000019f0| 61 63 6b 20 30 0a 09 6d | 6f 76 09 62 78 2c 23 30 |ack 0..m|ov.bx,#0|
|00001a00| 78 30 32 30 30 09 09 21 | 20 61 64 64 72 65 73 73 |x0200..!| address|
|00001a10| 20 3d 20 35 31 32 2c 20 | 69 6e 20 49 4e 49 54 53 | = 512, |in INITS|
|00001a20| 45 47 0a 09 6d 6f 76 09 | 61 78 2c 23 30 78 30 32 |EG..mov.|ax,#0x02|
|00001a30| 30 30 2b 53 45 54 55 50 | 53 45 43 53 09 21 20 73 |00+SETUP|SECS.! s|
|00001a40| 65 72 76 69 63 65 20 32 | 2c 20 6e 72 20 6f 66 20 |ervice 2|, nr of |
|00001a50| 73 65 63 74 6f 72 73 0a | 09 09 09 09 09 21 20 28 |sectors.|.....! (|
|00001a60| 61 73 73 75 6d 65 20 61 | 6c 6c 20 6f 6e 20 68 65 |assume a|ll on he|
|00001a70| 61 64 20 30 2c 20 74 72 | 61 63 6b 20 30 29 0a 09 |ad 0, tr|ack 0)..|
|00001a80| 69 6e 74 09 30 78 31 33 | 09 09 09 21 20 72 65 61 |int.0x13|...! rea|
|00001a90| 64 20 69 74 0a 09 6a 6e | 63 09 6f 6b 5f 6c 6f 61 |d it..jn|c.ok_loa|
|00001aa0| 64 5f 73 65 74 75 70 09 | 09 21 20 6f 6b 20 2d 20 |d_setup.|.! ok - |
|00001ab0| 63 6f 6e 74 69 6e 75 65 | 0a 0a 09 70 75 73 68 09 |continue|...push.|
|00001ac0| 61 78 09 09 09 21 20 64 | 75 6d 70 20 65 72 72 6f |ax...! d|ump erro|
|00001ad0| 72 20 63 6f 64 65 0a 09 | 63 61 6c 6c 09 70 72 69 |r code..|call.pri|
|00001ae0| 6e 74 5f 6e 6c 0a 09 6d | 6f 76 09 62 70 2c 20 73 |nt_nl..m|ov.bp, s|
|00001af0| 70 0a 09 63 61 6c 6c 09 | 70 72 69 6e 74 5f 68 65 |p..call.|print_he|
|00001b00| 78 0a 09 70 6f 70 09 61 | 78 09 0a 09 0a 09 78 6f |x..pop.a|x.....xo|
|00001b10| 72 09 64 6c 2c 20 64 6c | 09 09 09 21 20 72 65 73 |r.dl, dl|...! res|
|00001b20| 65 74 20 46 44 43 0a 09 | 78 6f 72 09 61 68 2c 20 |et FDC..|xor.ah, |
|00001b30| 61 68 0a 09 69 6e 74 09 | 30 78 31 33 0a 09 6a 6d |ah..int.|0x13..jm|
|00001b40| 70 09 6c 6f 61 64 5f 73 | 65 74 75 70 0a 0a 6f 6b |p.load_s|etup..ok|
|00001b50| 5f 6c 6f 61 64 5f 73 65 | 74 75 70 3a 0a 0a 21 20 |_load_se|tup:..! |
|00001b60| 47 65 74 20 64 69 73 6b | 20 64 72 69 76 65 20 70 |Get disk| drive p|
|00001b70| 61 72 61 6d 65 74 65 72 | 73 2c 20 73 70 65 63 69 |arameter|s, speci|
|00001b80| 66 69 63 61 6c 6c 79 20 | 6e 72 20 6f 66 20 73 65 |fically |nr of se|
|00001b90| 63 74 6f 72 73 2f 74 72 | 61 63 6b 0a 0a 23 69 66 |ctors/tr|ack..#if|
|00001ba0| 20 30 0a 0a 21 20 62 64 | 65 20 2d 20 74 68 65 20 | 0..! bd|e - the |
|00001bb0| 50 68 6f 65 6e 69 78 20 | 42 49 4f 53 20 6d 61 6e |Phoenix |BIOS man|
|00001bc0| 75 61 6c 20 73 61 79 73 | 20 66 75 6e 63 74 69 6f |ual says| functio|
|00001bd0| 6e 20 30 78 30 38 20 6f | 6e 6c 79 20 77 6f 72 6b |n 0x08 o|nly work|
|00001be0| 73 20 66 6f 72 20 66 69 | 78 65 64 0a 21 20 64 69 |s for fi|xed.! di|
|00001bf0| 73 6b 73 2e 20 20 49 74 | 20 64 6f 65 73 6e 27 74 |sks. It| doesn't|
|00001c00| 20 77 6f 72 6b 20 66 6f | 72 20 6f 6e 65 20 6f 66 | work fo|r one of|
|00001c10| 20 6d 79 20 42 49 4f 53 | 27 73 20 28 31 39 38 37 | my BIOS|'s (1987|
|00001c20| 20 41 77 61 72 64 29 2e | 20 20 49 74 20 77 61 73 | Award).| It was|
|00001c30| 0a 21 20 66 61 74 61 6c | 20 6e 6f 74 20 74 6f 20 |.! fatal| not to |
|00001c40| 63 68 65 63 6b 20 74 68 | 65 20 65 72 72 6f 72 20 |check th|e error |
|00001c50| 63 6f 64 65 2e 0a 0a 09 | 78 6f 72 09 64 6c 2c 64 |code....|xor.dl,d|
|00001c60| 6c 0a 09 6d 6f 76 09 61 | 68 2c 23 30 78 30 38 09 |l..mov.a|h,#0x08.|
|00001c70| 09 21 20 41 48 3d 38 20 | 69 73 20 67 65 74 20 64 |.! AH=8 |is get d|
|00001c80| 72 69 76 65 20 70 61 72 | 61 6d 65 74 65 72 73 0a |rive par|ameters.|
|00001c90| 09 69 6e 74 09 30 78 31 | 33 0a 09 78 6f 72 09 63 |.int.0x1|3..xor.c|
|00001ca0| 68 2c 63 68 0a 23 65 6c | 73 65 0a 0a 21 20 49 74 |h,ch.#el|se..! It|
|00001cb0| 20 73 65 65 6d 73 20 74 | 68 61 74 20 74 68 65 72 | seems t|hat ther|
|00001cc0| 65 20 69 73 20 6e 6f 20 | 42 49 4f 53 20 63 61 6c |e is no |BIOS cal|
|00001cd0| 6c 20 74 6f 20 67 65 74 | 20 74 68 65 20 6e 75 6d |l to get| the num|
|00001ce0| 62 65 72 20 6f 66 20 73 | 65 63 74 6f 72 73 2e 20 |ber of s|ectors. |
|00001cf0| 20 47 75 65 73 73 0a 21 | 20 31 38 20 73 65 63 74 | Guess.!| 18 sect|
|00001d00| 6f 72 73 20 69 66 20 73 | 65 63 74 6f 72 20 31 38 |ors if s|ector 18|
|00001d10| 20 63 61 6e 20 62 65 20 | 72 65 61 64 2c 20 31 35 | can be |read, 15|
|00001d20| 20 69 66 20 73 65 63 74 | 6f 72 20 31 35 20 63 61 | if sect|or 15 ca|
|00001d30| 6e 20 62 65 20 72 65 61 | 64 2e 0a 21 20 4f 74 68 |n be rea|d..! Oth|
|00001d40| 65 72 77 69 73 65 20 67 | 75 65 73 73 20 39 2e 0a |erwise g|uess 9..|
|00001d50| 0a 09 78 6f 72 09 64 78 | 2c 20 64 78 09 09 09 21 |..xor.dx|, dx...!|
|00001d60| 20 64 72 69 76 65 20 30 | 2c 20 68 65 61 64 20 30 | drive 0|, head 0|
|00001d70| 0a 09 6d 6f 76 09 63 78 | 2c 23 30 78 30 30 31 32 |..mov.cx|,#0x0012|
|00001d80| 09 09 21 20 73 65 63 74 | 6f 72 20 31 38 2c 20 74 |..! sect|or 18, t|
|00001d90| 72 61 63 6b 20 30 0a 09 | 6d 6f 76 09 62 78 2c 23 |rack 0..|mov.bx,#|
|00001da0| 30 78 30 32 30 30 2b 53 | 45 54 55 50 53 45 43 53 |0x0200+S|ETUPSECS|
|00001db0| 2a 30 78 32 30 30 20 20 | 21 20 61 64 64 72 65 73 |*0x200 |! addres|
|00001dc0| 73 20 61 66 74 65 72 20 | 73 65 74 75 70 20 28 65 |s after |setup (e|
|00001dd0| 73 20 3d 20 63 73 29 0a | 09 6d 6f 76 09 61 78 2c |s = cs).|.mov.ax,|
|00001de0| 23 30 78 30 32 30 31 09 | 09 21 20 73 65 72 76 69 |#0x0201.|.! servi|
|00001df0| 63 65 20 32 2c 20 31 20 | 73 65 63 74 6f 72 0a 09 |ce 2, 1 |sector..|
|00001e00| 69 6e 74 09 30 78 31 33 | 0a 09 6a 6e 63 09 67 6f |int.0x13|..jnc.go|
|00001e10| 74 5f 73 65 63 74 6f 72 | 73 0a 09 6d 6f 76 09 63 |t_sector|s..mov.c|
|00001e20| 6c 2c 23 30 78 30 66 09 | 09 21 20 73 65 63 74 6f |l,#0x0f.|.! secto|
|00001e30| 72 20 31 35 0a 09 6d 6f | 76 09 61 78 2c 23 30 78 |r 15..mo|v.ax,#0x|
|00001e40| 30 32 30 31 09 09 21 20 | 73 65 72 76 69 63 65 20 |0201..! |service |
|00001e50| 32 2c 20 31 20 73 65 63 | 74 6f 72 0a 09 69 6e 74 |2, 1 sec|tor..int|
|00001e60| 09 30 78 31 33 0a 09 6a | 6e 63 09 67 6f 74 5f 73 |.0x13..j|nc.got_s|
|00001e70| 65 63 74 6f 72 73 0a 09 | 6d 6f 76 09 63 6c 2c 23 |ectors..|mov.cl,#|
|00001e80| 30 78 30 39 0a 0a 23 65 | 6e 64 69 66 0a 0a 67 6f |0x09..#e|ndif..go|
|00001e90| 74 5f 73 65 63 74 6f 72 | 73 3a 0a 09 73 65 67 20 |t_sector|s:..seg |
|00001ea0| 63 73 0a 09 6d 6f 76 09 | 73 65 63 74 6f 72 73 2c |cs..mov.|sectors,|
|00001eb0| 63 78 0a 09 6d 6f 76 09 | 61 78 2c 23 49 4e 49 54 |cx..mov.|ax,#INIT|
|00001ec0| 53 45 47 0a 09 6d 6f 76 | 09 65 73 2c 61 78 0a 0a |SEG..mov|.es,ax..|
|00001ed0| 21 20 50 72 69 6e 74 20 | 73 6f 6d 65 20 69 6e 61 |! Print |some ina|
|00001ee0| 6e 65 20 6d 65 73 73 61 | 67 65 0a 0a 09 6d 6f 76 |ne messa|ge...mov|
|00001ef0| 09 61 68 2c 23 30 78 30 | 33 09 09 21 20 72 65 61 |.ah,#0x0|3..! rea|
|00001f00| 64 20 63 75 72 73 6f 72 | 20 70 6f 73 0a 09 78 6f |d cursor| pos..xo|
|00001f10| 72 09 62 68 2c 62 68 0a | 09 69 6e 74 09 30 78 31 |r.bh,bh.|.int.0x1|
|00001f20| 30 0a 09 0a 09 6d 6f 76 | 09 63 78 2c 23 39 0a 09 |0....mov|.cx,#9..|
|00001f30| 6d 6f 76 09 62 78 2c 23 | 30 78 30 30 30 37 09 09 |mov.bx,#|0x0007..|
|00001f40| 21 20 70 61 67 65 20 30 | 2c 20 61 74 74 72 69 62 |! page 0|, attrib|
|00001f50| 75 74 65 20 37 20 28 6e | 6f 72 6d 61 6c 29 0a 09 |ute 7 (n|ormal)..|
|00001f60| 6d 6f 76 09 62 70 2c 23 | 6d 73 67 31 0a 09 6d 6f |mov.bp,#|msg1..mo|
|00001f70| 76 09 61 78 2c 23 30 78 | 31 33 30 31 09 09 21 20 |v.ax,#0x|1301..! |
|00001f80| 77 72 69 74 65 20 73 74 | 72 69 6e 67 2c 20 6d 6f |write st|ring, mo|
|00001f90| 76 65 20 63 75 72 73 6f | 72 0a 09 69 6e 74 09 30 |ve curso|r..int.0|
|00001fa0| 78 31 30 0a 0a 21 20 6f | 6b 2c 20 77 65 27 76 65 |x10..! o|k, we've|
|00001fb0| 20 77 72 69 74 74 65 6e | 20 74 68 65 20 6d 65 73 | written| the mes|
|00001fc0| 73 61 67 65 2c 20 6e 6f | 77 0a 21 20 77 65 20 77 |sage, no|w.! we w|
|00001fd0| 61 6e 74 20 74 6f 20 6c | 6f 61 64 20 74 68 65 20 |ant to l|oad the |
|00001fe0| 73 79 73 74 65 6d 20 28 | 61 74 20 30 78 31 30 30 |system (|at 0x100|
|00001ff0| 30 30 29 0a 0a 09 6d 6f | 76 09 61 78 2c 23 54 53 |00)...mo|v.ax,#TS|
|00002000| 54 4c 4f 41 44 0a 09 6d | 6f 76 09 65 73 2c 61 78 |TLOAD..m|ov.es,ax|
|00002010| 09 09 21 20 73 65 67 6d | 65 6e 74 20 6f 66 20 30 |..! segm|ent of 0|
|00002020| 78 30 31 30 30 30 30 0a | 09 63 61 6c 6c 09 72 65 |x010000.|.call.re|
|00002030| 61 64 5f 69 74 0a 09 63 | 61 6c 6c 09 6b 69 6c 6c |ad_it..c|all.kill|
|00002040| 5f 6d 6f 74 6f 72 0a 09 | 63 61 6c 6c 09 70 72 69 |_motor..|call.pri|
|00002050| 6e 74 5f 6e 6c 0a 0a 21 | 20 41 66 74 65 72 20 74 |nt_nl..!| After t|
|00002060| 68 61 74 20 77 65 20 63 | 68 65 63 6b 20 77 68 69 |hat we c|heck whi|
|00002070| 63 68 20 72 6f 6f 74 2d | 64 65 76 69 63 65 20 74 |ch root-|device t|
|00002080| 6f 20 75 73 65 2e 20 49 | 66 20 74 68 65 20 64 65 |o use. I|f the de|
|00002090| 76 69 63 65 20 69 73 0a | 21 20 64 65 66 69 6e 65 |vice is.|! define|
|000020a0| 64 20 28 21 3d 20 30 29 | 2c 20 6e 6f 74 68 69 6e |d (!= 0)|, nothin|
|000020b0| 67 20 69 73 20 64 6f 6e | 65 20 61 6e 64 20 74 68 |g is don|e and th|
|000020c0| 65 20 67 69 76 65 6e 20 | 64 65 76 69 63 65 20 69 |e given |device i|
|000020d0| 73 20 75 73 65 64 2e 0a | 21 20 4f 74 68 65 72 77 |s used..|! Otherw|
|000020e0| 69 73 65 2c 20 65 69 74 | 68 65 72 20 2f 64 65 76 |ise, eit|her /dev|
|000020f0| 2f 50 53 30 20 28 32 2c | 32 38 29 20 6f 72 20 2f |/PS0 (2,|28) or /|
|00002100| 64 65 76 2f 61 74 30 20 | 28 32 2c 38 29 2c 20 64 |dev/at0 |(2,8), d|
|00002110| 65 70 65 6e 64 69 6e 67 | 0a 21 20 6f 6e 20 74 68 |epending|.! on th|
|00002120| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 73 65 63 74 |e number| of sect|
|00002130| 6f 72 73 20 74 68 61 74 | 20 74 68 65 20 42 49 4f |ors that| the BIO|
|00002140| 53 20 72 65 70 6f 72 74 | 73 20 63 75 72 72 65 6e |S report|s curren|
|00002150| 74 6c 79 2e 0a 0a 09 73 | 65 67 20 63 73 0a 09 6d |tly....s|eg cs..m|
|00002160| 6f 76 09 61 78 2c 72 6f | 6f 74 5f 64 65 76 0a 09 |ov.ax,ro|ot_dev..|
|00002170| 6f 72 09 61 78 2c 61 78 | 0a 09 6a 6e 65 09 72 6f |or.ax,ax|..jne.ro|
|00002180| 6f 74 5f 64 65 66 69 6e | 65 64 0a 09 73 65 67 20 |ot_defin|ed..seg |
|00002190| 63 73 0a 09 6d 6f 76 09 | 62 78 2c 73 65 63 74 6f |cs..mov.|bx,secto|
|000021a0| 72 73 0a 09 6d 6f 76 09 | 61 78 2c 23 30 78 30 32 |rs..mov.|ax,#0x02|
|000021b0| 30 38 09 09 21 20 2f 64 | 65 76 2f 70 73 30 20 2d |08..! /d|ev/ps0 -|
|000021c0| 20 31 2e 32 4d 62 0a 09 | 63 6d 70 09 62 78 2c 23 | 1.2Mb..|cmp.bx,#|
|000021d0| 31 35 0a 09 6a 65 09 72 | 6f 6f 74 5f 64 65 66 69 |15..je.r|oot_defi|
|000021e0| 6e 65 64 0a 09 6d 6f 76 | 09 61 78 2c 23 30 78 30 |ned..mov|.ax,#0x0|
|000021f0| 32 31 63 09 09 21 20 2f | 64 65 76 2f 50 53 30 20 |21c..! /|dev/PS0 |
|00002200| 2d 20 31 2e 34 34 4d 62 | 0a 09 63 6d 70 09 62 78 |- 1.44Mb|..cmp.bx|
|00002210| 2c 23 31 38 0a 09 6a 65 | 09 72 6f 6f 74 5f 64 65 |,#18..je|.root_de|
|00002220| 66 69 6e 65 64 0a 09 6d | 6f 76 09 61 78 2c 23 30 |fined..m|ov.ax,#0|
|00002230| 78 30 32 30 30 09 09 21 | 20 2f 64 65 76 2f 66 64 |x0200..!| /dev/fd|
|00002240| 30 20 2d 20 61 75 74 6f | 64 65 74 65 63 74 0a 72 |0 - auto|detect.r|
|00002250| 6f 6f 74 5f 64 65 66 69 | 6e 65 64 3a 0a 09 73 65 |oot_defi|ned:..se|
|00002260| 67 20 63 73 0a 09 6d 6f | 76 09 72 6f 6f 74 5f 64 |g cs..mo|v.root_d|
|00002270| 65 76 2c 61 78 0a 0a 21 | 20 61 66 74 65 72 20 74 |ev,ax..!| after t|
|00002280| 68 61 74 20 28 65 76 65 | 72 79 74 69 6e 67 20 6c |hat (eve|ryting l|
|00002290| 6f 61 64 65 64 29 2c 20 | 77 65 20 6a 75 6d 70 20 |oaded), |we jump |
|000022a0| 74 6f 0a 21 20 74 68 65 | 20 73 65 74 75 70 2d 72 |to.! the| setup-r|
|000022b0| 6f 75 74 69 6e 65 20 6c | 6f 61 64 65 64 20 64 69 |outine l|oaded di|
|000022c0| 72 65 63 74 6c 79 20 61 | 66 74 65 72 0a 21 20 74 |rectly a|fter.! t|
|000022d0| 68 65 20 62 6f 6f 74 62 | 6c 6f 63 6b 3a 0a 0a 09 |he bootb|lock:...|
|000022e0| 6a 6d 70 69 09 30 2c 53 | 45 54 55 50 53 45 47 0a |jmpi.0,S|ETUPSEG.|
|000022f0| 0a 21 20 54 68 69 73 20 | 72 6f 75 74 69 6e 65 20 |.! This |routine |
|00002300| 6c 6f 61 64 73 20 74 68 | 65 20 73 79 73 74 65 6d |loads th|e system|
|00002310| 20 61 74 20 61 64 64 72 | 65 73 73 20 30 78 31 30 | at addr|ess 0x10|
|00002320| 30 30 30 2c 20 6d 61 6b | 69 6e 67 20 73 75 72 65 |000, mak|ing sure|
|00002330| 0a 21 20 6e 6f 20 36 34 | 6b 42 20 62 6f 75 6e 64 |.! no 64|kB bound|
|00002340| 61 72 69 65 73 20 61 72 | 65 20 63 72 6f 73 73 65 |aries ar|e crosse|
|00002350| 64 2e 20 57 65 20 74 72 | 79 20 74 6f 20 6c 6f 61 |d. We tr|y to loa|
|00002360| 64 20 69 74 20 61 73 20 | 66 61 73 74 20 61 73 0a |d it as |fast as.|
|00002370| 21 20 70 6f 73 73 69 62 | 6c 65 2c 20 6c 6f 61 64 |! possib|le, load|
|00002380| 69 6e 67 20 77 68 6f 6c | 65 20 74 72 61 63 6b 73 |ing whol|e tracks|
|00002390| 20 77 68 65 6e 65 76 65 | 72 20 77 65 20 63 61 6e | wheneve|r we can|
|000023a0| 2e 0a 21 0a 21 20 69 6e | 3a 09 65 73 20 2d 20 73 |..!.! in|:.es - s|
|000023b0| 74 61 72 74 69 6e 67 20 | 61 64 64 72 65 73 73 20 |tarting |address |
|000023c0| 73 65 67 6d 65 6e 74 20 | 28 6e 6f 72 6d 61 6c 6c |segment |(normall|
|000023d0| 79 20 30 78 31 30 30 30 | 29 0a 21 0a 73 72 65 61 |y 0x1000|).!.srea|
|000023e0| 64 3a 09 2e 77 6f 72 64 | 20 31 2b 53 45 54 55 50 |d:..word| 1+SETUP|
|000023f0| 53 45 43 53 09 21 20 73 | 65 63 74 6f 72 73 20 72 |SECS.! s|ectors r|
|00002400| 65 61 64 20 6f 66 20 63 | 75 72 72 65 6e 74 20 74 |ead of c|urrent t|
|00002410| 72 61 63 6b 0a 68 65 61 | 64 3a 09 2e 77 6f 72 64 |rack.hea|d:..word|
|00002420| 20 30 09 09 09 21 20 63 | 75 72 72 65 6e 74 20 68 | 0...! c|urrent h|
|00002430| 65 61 64 0a 74 72 61 63 | 6b 3a 09 2e 77 6f 72 64 |ead.trac|k:..word|
|00002440| 20 30 09 09 09 21 20 63 | 75 72 72 65 6e 74 20 74 | 0...! c|urrent t|
|00002450| 72 61 63 6b 0a 0a 72 65 | 61 64 5f 69 74 3a 0a 09 |rack..re|ad_it:..|
|00002460| 6d 6f 76 20 61 78 2c 65 | 73 0a 09 74 65 73 74 20 |mov ax,e|s..test |
|00002470| 61 78 2c 23 30 78 30 66 | 66 66 0a 64 69 65 3a 09 |ax,#0x0f|ff.die:.|
|00002480| 6a 6e 65 20 64 69 65 09 | 09 09 21 20 65 73 20 6d |jne die.|..! es m|
|00002490| 75 73 74 20 62 65 20 61 | 74 20 36 34 6b 42 20 62 |ust be a|t 64kB b|
|000024a0| 6f 75 6e 64 61 72 79 0a | 09 78 6f 72 20 62 78 2c |oundary.|.xor bx,|
|000024b0| 62 78 09 09 21 20 62 78 | 20 69 73 20 73 74 61 72 |bx..! bx| is star|
|000024c0| 74 69 6e 67 20 61 64 64 | 72 65 73 73 20 77 69 74 |ting add|ress wit|
|000024d0| 68 69 6e 20 73 65 67 6d | 65 6e 74 0a 72 70 5f 72 |hin segm|ent.rp_r|
|000024e0| 65 61 64 3a 0a 09 6d 6f | 76 20 61 78 2c 65 73 0a |ead:..mo|v ax,es.|
|000024f0| 09 73 75 62 20 61 78 2c | 23 54 53 54 4c 4f 41 44 |.sub ax,|#TSTLOAD|
|00002500| 0a 09 63 6d 70 20 61 78 | 2c 73 79 73 73 69 7a 65 |..cmp ax|,syssize|
|00002510| 09 09 21 20 68 61 76 65 | 20 77 65 20 6c 6f 61 64 |..! have| we load|
|00002520| 65 64 20 61 6c 6c 20 79 | 65 74 3f 0a 09 6a 62 65 |ed all y|et?..jbe|
|00002530| 20 6f 6b 31 5f 72 65 61 | 64 0a 09 72 65 74 0a 6f | ok1_rea|d..ret.o|
|00002540| 6b 31 5f 72 65 61 64 3a | 0a 09 73 65 67 20 63 73 |k1_read:|..seg cs|
|00002550| 0a 09 6d 6f 76 20 61 78 | 2c 73 65 63 74 6f 72 73 |..mov ax|,sectors|
|00002560| 0a 09 73 75 62 20 61 78 | 2c 73 72 65 61 64 0a 09 |..sub ax|,sread..|
|00002570| 6d 6f 76 20 63 78 2c 61 | 78 0a 09 73 68 6c 20 63 |mov cx,a|x..shl c|
|00002580| 78 2c 23 39 0a 09 61 64 | 64 20 63 78 2c 62 78 0a |x,#9..ad|d cx,bx.|
|00002590| 09 6a 6e 63 20 6f 6b 32 | 5f 72 65 61 64 0a 09 6a |.jnc ok2|_read..j|
|000025a0| 65 20 6f 6b 32 5f 72 65 | 61 64 0a 09 78 6f 72 20 |e ok2_re|ad..xor |
|000025b0| 61 78 2c 61 78 0a 09 73 | 75 62 20 61 78 2c 62 78 |ax,ax..s|ub ax,bx|
|000025c0| 0a 09 73 68 72 20 61 78 | 2c 23 39 0a 6f 6b 32 5f |..shr ax|,#9.ok2_|
|000025d0| 72 65 61 64 3a 0a 09 63 | 61 6c 6c 20 72 65 61 64 |read:..c|all read|
|000025e0| 5f 74 72 61 63 6b 0a 09 | 6d 6f 76 20 63 78 2c 61 |_track..|mov cx,a|
|000025f0| 78 0a 09 61 64 64 20 61 | 78 2c 73 72 65 61 64 0a |x..add a|x,sread.|
|00002600| 09 73 65 67 20 63 73 0a | 09 63 6d 70 20 61 78 2c |.seg cs.|.cmp ax,|
|00002610| 73 65 63 74 6f 72 73 0a | 09 6a 6e 65 20 6f 6b 33 |sectors.|.jne ok3|
|00002620| 5f 72 65 61 64 0a 09 6d | 6f 76 20 61 78 2c 23 31 |_read..m|ov ax,#1|
|00002630| 0a 09 73 75 62 20 61 78 | 2c 68 65 61 64 0a 09 6a |..sub ax|,head..j|
|00002640| 6e 65 20 6f 6b 34 5f 72 | 65 61 64 0a 09 69 6e 63 |ne ok4_r|ead..inc|
|00002650| 20 74 72 61 63 6b 0a 6f | 6b 34 5f 72 65 61 64 3a | track.o|k4_read:|
|00002660| 0a 09 6d 6f 76 20 68 65 | 61 64 2c 61 78 0a 09 78 |..mov he|ad,ax..x|
|00002670| 6f 72 20 61 78 2c 61 78 | 0a 6f 6b 33 5f 72 65 61 |or ax,ax|.ok3_rea|
|00002680| 64 3a 0a 09 6d 6f 76 20 | 73 72 65 61 64 2c 61 78 |d:..mov |sread,ax|
|00002690| 0a 09 73 68 6c 20 63 78 | 2c 23 39 0a 09 61 64 64 |..shl cx|,#9..add|
|000026a0| 20 62 78 2c 63 78 0a 09 | 6a 6e 63 20 72 70 5f 72 | bx,cx..|jnc rp_r|
|000026b0| 65 61 64 0a 09 6d 6f 76 | 20 61 78 2c 65 73 0a 09 |ead..mov| ax,es..|
|000026c0| 61 64 64 20 61 68 2c 23 | 30 78 31 30 0a 09 6d 6f |add ah,#|0x10..mo|
|000026d0| 76 20 65 73 2c 61 78 0a | 09 78 6f 72 20 62 78 2c |v es,ax.|.xor bx,|
|000026e0| 62 78 0a 09 6a 6d 70 20 | 72 70 5f 72 65 61 64 0a |bx..jmp |rp_read.|
|000026f0| 0a 72 65 61 64 5f 74 72 | 61 63 6b 3a 0a 09 70 75 |.read_tr|ack:..pu|
|00002700| 73 68 61 0a 09 70 75 73 | 68 61 09 0a 09 6d 6f 76 |sha..pus|ha...mov|
|00002710| 09 61 78 2c 20 23 30 78 | 65 32 65 20 09 21 20 6c |.ax, #0x|e2e .! l|
|00002720| 6f 61 64 69 6e 67 2e 2e | 2e 20 6d 65 73 73 61 67 |oading..|. messag|
|00002730| 65 20 32 65 20 3d 20 2e | 0a 09 6d 6f 76 09 62 78 |e 2e = .|..mov.bx|
|00002740| 2c 20 23 37 0a 20 09 69 | 6e 74 09 30 78 31 30 0a |, #7. .i|nt.0x10.|
|00002750| 09 70 6f 70 61 09 09 0a | 0a 09 6d 6f 76 09 64 78 |.popa...|..mov.dx|
|00002760| 2c 74 72 61 63 6b 0a 09 | 6d 6f 76 09 63 78 2c 73 |,track..|mov.cx,s|
|00002770| 72 65 61 64 0a 09 69 6e | 63 09 63 78 0a 09 6d 6f |read..in|c.cx..mo|
|00002780| 76 09 63 68 2c 64 6c 0a | 09 6d 6f 76 09 64 78 2c |v.ch,dl.|.mov.dx,|
|00002790| 68 65 61 64 0a 09 6d 6f | 76 09 64 68 2c 64 6c 0a |head..mo|v.dh,dl.|
|000027a0| 09 61 6e 64 09 64 78 2c | 23 30 78 30 31 30 30 0a |.and.dx,|#0x0100.|
|000027b0| 09 6d 6f 76 09 61 68 2c | 23 32 0a 09 0a 09 70 75 |.mov.ah,|#2....pu|
|000027c0| 73 68 09 64 78 09 09 09 | 09 21 20 73 61 76 65 20 |sh.dx...|.! save |
|000027d0| 66 6f 72 20 65 72 72 6f | 72 20 64 75 6d 70 0a 09 |for erro|r dump..|
|000027e0| 70 75 73 68 09 63 78 0a | 09 70 75 73 68 09 62 78 |push.cx.|.push.bx|
|000027f0| 0a 09 70 75 73 68 09 61 | 78 0a 0a 09 69 6e 74 09 |..push.a|x...int.|
|00002800| 30 78 31 33 0a 09 6a 63 | 09 62 61 64 5f 72 74 0a |0x13..jc|.bad_rt.|
|00002810| 09 61 64 64 09 73 70 2c | 20 23 38 0a 09 70 6f 70 |.add.sp,| #8..pop|
|00002820| 61 0a 09 72 65 74 0a 0a | 62 61 64 5f 72 74 3a 09 |a..ret..|bad_rt:.|
|00002830| 70 75 73 68 09 61 78 09 | 09 09 09 21 20 73 61 76 |push.ax.|...! sav|
|00002840| 65 20 65 72 72 6f 72 20 | 63 6f 64 65 0a 09 63 61 |e error |code..ca|
|00002850| 6c 6c 09 70 72 69 6e 74 | 5f 61 6c 6c 09 09 09 21 |ll.print|_all...!|
|00002860| 20 61 68 20 3d 20 65 72 | 72 6f 72 2c 20 61 6c 20 | ah = er|ror, al |
|00002870| 3d 20 72 65 61 64 0a 09 | 0a 09 0a 09 78 6f 72 20 |= read..|....xor |
|00002880| 61 68 2c 61 68 0a 09 78 | 6f 72 20 64 6c 2c 64 6c |ah,ah..x|or dl,dl|
|00002890| 0a 09 69 6e 74 20 30 78 | 31 33 0a 09 0a 0a 09 61 |..int 0x|13.....a|
|000028a0| 64 64 09 73 70 2c 20 23 | 31 30 0a 09 70 6f 70 61 |dd.sp, #|10..popa|
|000028b0| 09 0a 09 6a 6d 70 20 72 | 65 61 64 5f 74 72 61 63 |...jmp r|ead_trac|
|000028c0| 6b 0a 0a 2f 2a 0a 20 2a | 09 70 72 69 6e 74 5f 61 |k../*. *|.print_a|
|000028d0| 6c 6c 20 69 73 20 66 6f | 72 20 64 65 62 75 67 67 |ll is fo|r debugg|
|000028e0| 69 6e 67 20 70 75 72 70 | 6f 73 65 73 2e 20 20 0a |ing purp|oses. .|
|000028f0| 20 2a 09 49 74 20 77 69 | 6c 6c 20 70 72 69 6e 74 | *.It wi|ll print|
|00002900| 20 6f 75 74 20 61 6c 6c | 20 6f 66 20 74 68 65 20 | out all| of the |
|00002910| 72 65 67 69 73 74 65 72 | 73 2e 20 20 54 68 65 20 |register|s. The |
|00002920| 61 73 73 75 6d 70 74 69 | 6f 6e 20 69 73 20 74 68 |assumpti|on is th|
|00002930| 61 74 20 74 68 69 73 20 | 69 73 0a 20 2a 09 63 61 |at this |is. *.ca|
|00002940| 6c 6c 65 64 20 66 72 6f | 6d 20 61 20 72 6f 75 74 |lled fro|m a rout|
|00002950| 69 6e 65 2c 20 77 69 74 | 68 20 61 20 73 74 61 63 |ine, wit|h a stac|
|00002960| 6b 20 66 72 61 6d 65 20 | 6c 69 6b 65 0a 20 2a 09 |k frame |like. *.|
|00002970| 64 78 20 0a 20 2a 09 63 | 78 0a 20 2a 09 62 78 0a |dx . *.c|x. *.bx.|
|00002980| 20 2a 09 61 78 0a 20 2a | 09 65 72 72 6f 72 0a 20 | *.ax. *|.error. |
|00002990| 2a 09 72 65 74 20 3c 2d | 20 73 70 0a 20 2a 0a 2a |*.ret <-| sp. *.*|
|000029a0| 2f 0a 20 0a 70 72 69 6e | 74 5f 61 6c 6c 3a 0a 09 |/. .prin|t_all:..|
|000029b0| 6d 6f 76 09 63 78 2c 20 | 23 35 09 09 21 20 65 72 |mov.cx, |#5..! er|
|000029c0| 72 6f 72 20 63 6f 64 65 | 20 2b 20 34 20 72 65 67 |ror code| + 4 reg|
|000029d0| 69 73 74 65 72 73 0a 09 | 6d 6f 76 09 62 70 2c 20 |isters..|mov.bp, |
|000029e0| 73 70 09 0a 0a 70 72 69 | 6e 74 5f 6c 6f 6f 70 3a |sp...pri|nt_loop:|
|000029f0| 0a 09 70 75 73 68 09 63 | 78 09 09 21 20 73 61 76 |..push.c|x..! sav|
|00002a00| 65 20 63 6f 75 6e 74 20 | 6c 65 66 74 0a 09 63 61 |e count |left..ca|
|00002a10| 6c 6c 09 70 72 69 6e 74 | 5f 6e 6c 09 21 20 6e 6c |ll.print|_nl.! nl|
|00002a20| 20 66 6f 72 20 72 65 61 | 64 61 62 69 6c 69 74 79 | for rea|dability|
|00002a30| 0a 0a 09 63 6d 70 09 63 | 6c 2c 20 35 0a 09 6a 61 |...cmp.c|l, 5..ja|
|00002a40| 65 09 6e 6f 5f 72 65 67 | 09 09 21 20 73 65 65 20 |e.no_reg|..! see |
|00002a50| 69 66 20 72 65 67 69 73 | 74 65 72 20 6e 61 6d 65 |if regis|ter name|
|00002a60| 20 69 73 20 6e 65 65 64 | 65 64 0a 09 0a 09 6d 6f | is need|ed....mo|
|00002a70| 76 09 61 78 2c 20 23 30 | 78 65 30 35 20 2b 20 27 |v.ax, #0|xe05 + '|
|00002a80| 41 20 2d 20 31 0a 09 73 | 75 62 09 61 6c 2c 20 63 |A - 1..s|ub.al, c|
|00002a90| 6c 0a 09 69 6e 74 09 30 | 78 31 30 0a 0a 09 6d 6f |l..int.0|x10...mo|
|00002aa0| 76 09 61 6c 2c 20 23 27 | 58 0a 09 69 6e 74 09 30 |v.al, #'|X..int.0|
|00002ab0| 78 31 30 0a 0a 09 6d 6f | 76 09 61 6c 2c 20 23 27 |x10...mo|v.al, #'|
|00002ac0| 3a 0a 09 69 6e 74 09 30 | 78 31 30 0a 0a 6e 6f 5f |:..int.0|x10..no_|
|00002ad0| 72 65 67 3a 0a 09 61 64 | 64 09 62 70 2c 20 23 32 |reg:..ad|d.bp, #2|
|00002ae0| 09 09 21 20 6e 65 78 74 | 20 72 65 67 69 73 74 65 |..! next| registe|
|00002af0| 72 0a 09 63 61 6c 6c 09 | 70 72 69 6e 74 5f 68 65 |r..call.|print_he|
|00002b00| 78 09 21 20 70 72 69 6e | 74 20 69 74 0a 09 70 6f |x.! prin|t it..po|
|00002b10| 70 09 63 78 0a 09 6c 6f | 6f 70 09 70 72 69 6e 74 |p.cx..lo|op.print|
|00002b20| 5f 6c 6f 6f 70 0a 09 72 | 65 74 0a 0a 70 72 69 6e |_loop..r|et..prin|
|00002b30| 74 5f 6e 6c 3a 0a 09 6d | 6f 76 09 61 78 2c 20 23 |t_nl:..m|ov.ax, #|
|00002b40| 30 78 65 30 64 09 21 20 | 43 52 0a 09 69 6e 74 09 |0xe0d.! |CR..int.|
|00002b50| 30 78 31 30 0a 09 6d 6f | 76 09 61 6c 2c 20 23 30 |0x10..mo|v.al, #0|
|00002b60| 78 61 09 21 20 4c 46 0a | 09 69 6e 74 20 09 30 78 |xa.! LF.|.int .0x|
|00002b70| 31 30 0a 09 72 65 74 0a | 0a 2f 2a 0a 20 2a 09 70 |10..ret.|./*. *.p|
|00002b80| 72 69 6e 74 5f 68 65 78 | 20 69 73 20 66 6f 72 20 |rint_hex| is for |
|00002b90| 64 65 62 75 67 67 69 6e | 67 20 70 75 72 70 6f 73 |debuggin|g purpos|
|00002ba0| 65 73 2c 20 61 6e 64 20 | 70 72 69 6e 74 73 20 74 |es, and |prints t|
|00002bb0| 68 65 20 77 6f 72 64 0a | 20 2a 09 70 6f 69 6e 74 |he word.| *.point|
|00002bc0| 65 64 20 74 6f 20 62 79 | 20 73 73 3a 62 70 20 69 |ed to by| ss:bp i|
|00002bd0| 6e 20 68 65 78 61 64 65 | 63 6d 69 61 6c 2e 0a 2a |n hexade|cmial..*|
|00002be0| 2f 0a 0a 70 72 69 6e 74 | 5f 68 65 78 3a 0a 09 6d |/..print|_hex:..m|
|00002bf0| 6f 76 09 63 78 2c 20 23 | 34 09 09 21 20 34 20 68 |ov.cx, #|4..! 4 h|
|00002c00| 65 78 20 64 69 67 69 74 | 73 0a 09 6d 6f 76 09 64 |ex digit|s..mov.d|
|00002c10| 78 2c 20 28 62 70 29 09 | 21 20 6c 6f 61 64 20 77 |x, (bp).|! load w|
|00002c20| 6f 72 64 20 69 6e 74 6f | 20 64 78 0a 70 72 69 6e |ord into| dx.prin|
|00002c30| 74 5f 64 69 67 69 74 3a | 0a 09 72 6f 6c 09 64 78 |t_digit:|..rol.dx|
|00002c40| 2c 20 23 34 09 09 21 20 | 72 6f 74 61 74 65 20 73 |, #4..! |rotate s|
|00002c50| 6f 20 74 68 61 74 20 6c | 6f 77 65 73 74 20 34 20 |o that l|owest 4 |
|00002c60| 62 69 74 73 20 61 72 65 | 20 75 73 65 64 0a 09 6d |bits are| used..m|
|00002c70| 6f 76 09 61 68 2c 20 23 | 30 78 65 09 0a 09 6d 6f |ov.ah, #|0xe...mo|
|00002c80| 76 09 61 6c 2c 20 64 6c | 09 09 21 20 6d 61 73 6b |v.al, dl|..! mask|
|00002c90| 20 6f 66 66 20 73 6f 20 | 77 65 20 68 61 76 65 20 | off so |we have |
|00002ca0| 6f 6e 6c 79 20 6e 65 78 | 74 20 6e 69 62 62 6c 65 |only nex|t nibble|
|00002cb0| 0a 09 61 6e 64 09 61 6c | 2c 20 23 30 78 66 0a 09 |..and.al|, #0xf..|
|00002cc0| 61 64 64 09 61 6c 2c 20 | 23 27 30 09 09 21 20 63 |add.al, |#'0..! c|
|00002cd0| 6f 6e 76 65 72 74 20 74 | 6f 20 30 2d 62 61 73 65 |onvert t|o 0-base|
|00002ce0| 64 20 64 69 67 69 74 0a | 09 63 6d 70 09 61 6c 2c |d digit.|.cmp.al,|
|00002cf0| 20 23 27 39 09 09 21 20 | 63 68 65 63 6b 20 66 6f | #'9..! |check fo|
|00002d00| 72 20 6f 76 65 72 66 6c | 6f 77 0a 09 6a 62 65 09 |r overfl|ow..jbe.|
|00002d10| 67 6f 6f 64 5f 64 69 67 | 69 74 0a 09 61 64 64 09 |good_dig|it..add.|
|00002d20| 61 6c 2c 20 23 27 41 20 | 2d 20 27 30 20 2d 20 31 |al, #'A |- '0 - 1|
|00002d30| 30 0a 0a 67 6f 6f 64 5f | 64 69 67 69 74 3a 0a 09 |0..good_|digit:..|
|00002d40| 69 6e 74 09 30 78 31 30 | 0a 09 6c 6f 6f 70 09 70 |int.0x10|..loop.p|
|00002d50| 72 69 6e 74 5f 64 69 67 | 69 74 0a 09 72 65 74 0a |rint_dig|it..ret.|
|00002d60| 0a 0a 2f 2a 0a 20 2a 20 | 54 68 69 73 20 70 72 6f |../*. * |This pro|
|00002d70| 63 65 64 75 72 65 20 74 | 75 72 6e 73 20 6f 66 66 |cedure t|urns off|
|00002d80| 20 74 68 65 20 66 6c 6f | 70 70 79 20 64 72 69 76 | the flo|ppy driv|
|00002d90| 65 20 6d 6f 74 6f 72 2c | 20 73 6f 0a 20 2a 20 74 |e motor,| so. * t|
|00002da0| 68 61 74 20 77 65 20 65 | 6e 74 65 72 20 74 68 65 |hat we e|nter the|
|00002db0| 20 6b 65 72 6e 65 6c 20 | 69 6e 20 61 20 6b 6e 6f | kernel |in a kno|
|00002dc0| 77 6e 20 73 74 61 74 65 | 2c 20 61 6e 64 0a 20 2a |wn state|, and. *|
|00002dd0| 20 64 6f 6e 27 74 20 68 | 61 76 65 20 74 6f 20 77 | don't h|ave to w|
|00002de0| 6f 72 72 79 20 61 62 6f | 75 74 20 69 74 20 6c 61 |orry abo|ut it la|
|00002df0| 74 65 72 2e 0a 20 2a 2f | 0a 6b 69 6c 6c 5f 6d 6f |ter.. */|.kill_mo|
|00002e00| 74 6f 72 3a 0a 09 70 75 | 73 68 20 64 78 0a 09 6d |tor:..pu|sh dx..m|
|00002e10| 6f 76 20 64 78 2c 23 30 | 78 33 66 32 0a 09 78 6f |ov dx,#0|x3f2..xo|
|00002e20| 72 20 61 6c 2c 20 61 6c | 0a 09 6f 75 74 62 0a 09 |r al, al|..outb..|
|00002e30| 70 6f 70 20 64 78 0a 09 | 72 65 74 0a 0a 73 65 63 |pop dx..|ret..sec|
|00002e40| 74 6f 72 73 3a 0a 09 2e | 77 6f 72 64 20 30 0a 0a |tors:...|word 0..|
|00002e50| 6d 73 67 31 3a 0a 09 2e | 62 79 74 65 20 31 33 2c |msg1:...|byte 13,|
|00002e60| 31 30 0a 09 2e 61 73 63 | 69 69 20 22 4c 6f 61 64 |10...asc|ii "Load|
|00002e70| 69 6e 67 22 0a 0a 2e 6f | 72 67 20 35 30 36 0a 73 |ing"...o|rg 506.s|
|00002e80| 79 73 73 69 7a 65 3a 0a | 09 2e 77 6f 72 64 20 54 |yssize:.|..word T|
|00002e90| 53 54 53 49 5a 45 2f 30 | 78 31 30 0a 72 6f 6f 74 |STSIZE/0|x10.root|
|00002ea0| 5f 64 65 76 3a 0a 09 2e | 77 6f 72 64 20 52 4f 4f |_dev:...|word ROO|
|00002eb0| 54 5f 44 45 56 0a 62 6f | 6f 74 5f 66 6c 61 67 3a |T_DEV.bo|ot_flag:|
|00002ec0| 0a 09 2e 77 6f 72 64 20 | 30 78 41 41 35 35 0a 00 |...word |0xAA55..|
|00002ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003000| 6d 65 6d 74 65 73 74 38 | 36 2f 62 75 69 6c 64 2e |memtest8|6/build.|
|00003010| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00003020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003060| 00 00 00 00 31 30 30 37 | 35 35 20 00 20 32 30 32 |....1007|55 . 202|
|00003070| 35 32 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |52 . | 0 . |
|00003080| 20 20 31 32 31 35 31 20 | 20 36 31 35 31 37 31 37 | 12151 | 6151717|
|00003090| 31 32 37 20 20 31 32 36 | 36 32 00 20 30 00 00 00 |127 126|62. 0...|
|000030a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000030f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003100| 00 75 73 74 61 72 20 20 | 00 63 62 72 61 64 79 00 |.ustar |.cbrady.|
|00003110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003120| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00003130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003200| 2f 2a 0a 20 2a 20 20 6c | 69 6e 75 78 2f 74 6f 6f |/*. * l|inux/too|
|00003210| 6c 73 2f 62 75 69 6c 64 | 2e 63 0a 20 2a 0a 20 2a |ls/build|.c. *. *|
|00003220| 20 20 43 6f 70 79 72 69 | 67 68 74 20 28 43 29 20 | Copyri|ght (C) |
|00003230| 31 39 39 31 2c 20 31 39 | 39 32 20 20 4c 69 6e 75 |1991, 19|92 Linu|
|00003240| 73 20 54 6f 72 76 61 6c | 64 73 0a 20 2a 2f 0a 0a |s Torval|ds. */..|
|00003250| 2f 2a 0a 20 2a 20 54 68 | 69 73 20 66 69 6c 65 20 |/*. * Th|is file |
|00003260| 62 75 69 6c 64 73 20 61 | 20 64 69 73 6b 2d 69 6d |builds a| disk-im|
|00003270| 61 67 65 20 66 72 6f 6d | 20 74 68 72 65 65 20 64 |age from| three d|
|00003280| 69 66 66 65 72 65 6e 74 | 20 66 69 6c 65 73 3a 0a |ifferent| files:.|
|00003290| 20 2a 0a 20 2a 20 2d 20 | 62 6f 6f 74 73 65 63 74 | *. * - |bootsect|
|000032a0| 3a 20 6d 61 78 20 35 31 | 30 20 62 79 74 65 73 20 |: max 51|0 bytes |
|000032b0| 6f 66 20 38 30 38 36 20 | 6d 61 63 68 69 6e 65 20 |of 8086 |machine |
|000032c0| 63 6f 64 65 2c 20 6c 6f | 61 64 73 20 74 68 65 20 |code, lo|ads the |
|000032d0| 72 65 73 74 0a 20 2a 20 | 2d 20 73 65 74 75 70 3a |rest. * |- setup:|
|000032e0| 20 6d 61 78 20 34 20 73 | 65 63 74 6f 72 73 20 6f | max 4 s|ectors o|
|000032f0| 66 20 38 30 38 36 20 6d | 61 63 68 69 6e 65 20 63 |f 8086 m|achine c|
|00003300| 6f 64 65 2c 20 73 65 74 | 73 20 75 70 20 73 79 73 |ode, set|s up sys|
|00003310| 74 65 6d 20 70 61 72 6d | 0a 20 2a 20 2d 20 74 65 |tem parm|. * - te|
|00003320| 73 74 3a 20 38 30 33 38 | 36 20 63 6f 64 65 20 66 |st: 8038|6 code f|
|00003330| 6f 72 20 61 63 74 75 61 | 6c 20 73 79 73 74 65 6d |or actua|l system|
|00003340| 0a 20 2a 0a 20 2a 20 49 | 74 20 64 6f 65 73 20 73 |. *. * I|t does s|
|00003350| 6f 6d 65 20 63 68 65 63 | 6b 69 6e 67 20 74 68 61 |ome chec|king tha|
|00003360| 74 20 61 6c 6c 20 66 69 | 6c 65 73 20 61 72 65 20 |t all fi|les are |
|00003370| 6f 66 20 74 68 65 20 63 | 6f 72 72 65 63 74 20 74 |of the c|orrect t|
|00003380| 79 70 65 2c 20 61 6e 64 | 0a 20 2a 20 6a 75 73 74 |ype, and|. * just|
|00003390| 20 77 72 69 74 65 73 20 | 74 68 65 20 72 65 73 75 | writes |the resu|
|000033a0| 6c 74 20 74 6f 20 73 74 | 64 6f 75 74 2c 20 72 65 |lt to st|dout, re|
|000033b0| 6d 6f 76 69 6e 67 20 68 | 65 61 64 65 72 73 20 61 |moving h|eaders a|
|000033c0| 6e 64 20 70 61 64 64 69 | 6e 67 20 74 6f 0a 20 2a |nd paddi|ng to. *|
|000033d0| 20 74 68 65 20 72 69 67 | 68 74 20 61 6d 6f 75 6e | the rig|ht amoun|
|000033e0| 74 2e 20 49 74 20 61 6c | 73 6f 20 77 72 69 74 65 |t. It al|so write|
|000033f0| 73 20 73 6f 6d 65 20 73 | 79 73 74 65 6d 20 64 61 |s some s|ystem da|
|00003400| 74 61 20 74 6f 20 73 74 | 64 65 72 72 2e 0a 20 2a |ta to st|derr.. *|
|00003410| 2f 0a 0a 2f 2a 0a 20 2a | 20 31 2d 4a 61 6e 2d 39 |/../*. *| 1-Jan-9|
|00003420| 36 20 2d 20 4d 6f 64 69 | 66 69 65 64 20 62 79 20 |6 - Modi|fied by |
|00003430| 43 68 72 69 73 20 42 72 | 61 64 79 20 74 6f 20 63 |Chris Br|ady to c|
|00003440| 72 65 61 74 65 20 61 20 | 62 6f 6f 74 61 62 6c 65 |reate a |bootable|
|00003450| 20 4d 65 6d 54 65 73 74 | 2d 38 36 20 69 6d 61 67 | MemTest|-86 imag|
|00003460| 65 2e 0a 20 2a 20 4d 6f | 73 74 6c 79 20 6a 75 73 |e.. * Mo|stly jus|
|00003470| 74 20 72 69 70 70 65 64 | 20 6f 75 74 20 63 6f 64 |t ripped| out cod|
|00003480| 65 20 66 6f 72 20 72 6f | 6f 74 20 64 65 76 69 63 |e for ro|ot devic|
|00003490| 65 20 63 68 65 63 6b 73 | 2e 0a 20 2a 2f 0a 0a 23 |e checks|.. */..#|
|000034a0| 69 6e 63 6c 75 64 65 20 | 3c 73 74 64 69 6f 2e 68 |include |<stdio.h|
|000034b0| 3e 09 2f 2a 20 66 70 72 | 69 6e 74 66 20 2a 2f 0a |>./* fpr|intf */.|
|000034c0| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 72 69 6e 67 |#include| <string|
|000034d0| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |.h>.#inc|lude <st|
|000034e0| 64 6c 69 62 2e 68 3e 09 | 2f 2a 20 63 6f 6e 74 61 |dlib.h>.|/* conta|
|000034f0| 69 6e 73 20 65 78 69 74 | 20 2a 2f 0a 23 69 6e 63 |ins exit| */.#inc|
|00003500| 6c 75 64 65 20 3c 73 79 | 73 2f 74 79 70 65 73 2e |lude <sy|s/types.|
|00003510| 68 3e 09 2f 2a 20 75 6e | 69 73 74 64 2e 68 20 6e |h>./* un|istd.h n|
|00003520| 65 65 64 73 20 74 68 69 | 73 20 2a 2f 0a 23 69 6e |eeds thi|s */.#in|
|00003530| 63 6c 75 64 65 20 3c 73 | 79 73 2f 73 74 61 74 2e |clude <s|ys/stat.|
|00003540| 68 3e 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 79 73 |h>.#incl|ude <sys|
|00003550| 2f 73 79 73 6d 61 63 72 | 6f 73 2e 68 3e 0a 23 69 |/sysmacr|os.h>.#i|
|00003560| 6e 63 6c 75 64 65 20 3c | 75 6e 69 73 74 64 2e 68 |nclude <|unistd.h|
|00003570| 3e 09 2f 2a 20 63 6f 6e | 74 61 69 6e 73 20 72 65 |>./* con|tains re|
|00003580| 61 64 2f 77 72 69 74 65 | 20 2a 2f 0a 23 69 6e 63 |ad/write| */.#inc|
|00003590| 6c 75 64 65 20 3c 66 63 | 6e 74 6c 2e 68 3e 0a 23 |lude <fc|ntl.h>.#|
|000035a0| 69 6e 63 6c 75 64 65 20 | 3c 6c 69 6e 75 78 2f 61 |include |<linux/a|
|000035b0| 2e 6f 75 74 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |.out.h>.|#include|
|000035c0| 20 22 6d 74 65 73 74 2e | 68 22 0a 0a 23 64 65 66 | "mtest.|h"..#def|
|000035d0| 69 6e 65 20 4d 49 4e 49 | 58 5f 48 45 41 44 45 52 |ine MINI|X_HEADER|
|000035e0| 20 33 32 0a 23 64 65 66 | 69 6e 65 20 4e 5f 4d 41 | 32.#def|ine N_MA|
|000035f0| 47 49 43 5f 4f 46 46 53 | 45 54 20 31 30 32 34 0a |GIC_OFFS|ET 1024.|
|00003600| 73 74 61 74 69 63 20 69 | 6e 74 20 47 43 43 5f 48 |static i|nt GCC_H|
|00003610| 45 41 44 45 52 20 3d 20 | 73 69 7a 65 6f 66 28 73 |EADER = |sizeof(s|
|00003620| 74 72 75 63 74 20 65 78 | 65 63 29 3b 0a 0a 2f 2a |truct ex|ec);../*|
|00003630| 20 6d 61 78 20 6e 72 20 | 6f 66 20 73 65 63 74 6f | max nr |of secto|
|00003640| 72 73 20 6f 66 20 73 65 | 74 75 70 3a 20 64 6f 6e |rs of se|tup: don|
|00003650| 27 74 20 63 68 61 6e 67 | 65 20 75 6e 6c 65 73 73 |'t chang|e unless|
|00003660| 20 79 6f 75 20 61 6c 73 | 6f 20 63 68 61 6e 67 65 | you als|o change|
|00003670| 0a 20 2a 20 62 6f 6f 74 | 73 65 63 74 20 65 74 63 |. * boot|sect etc|
|00003680| 20 2a 2f 0a 0a 23 64 65 | 66 69 6e 65 20 53 54 52 | */..#de|fine STR|
|00003690| 49 4e 47 49 46 59 28 78 | 29 20 23 78 0a 0a 74 79 |INGIFY(x|) #x..ty|
|000036a0| 70 65 64 65 66 20 75 6e | 69 6f 6e 20 7b 0a 09 6c |pedef un|ion {..l|
|000036b0| 6f 6e 67 20 6c 3b 0a 09 | 73 68 6f 72 74 20 73 5b |ong l;..|short s[|
|000036c0| 32 5d 3b 0a 09 63 68 61 | 72 20 62 5b 34 5d 3b 0a |2];..cha|r b[4];.|
|000036d0| 7d 20 63 6f 6e 76 3b 0a | 0a 6c 6f 6e 67 20 69 6e |} conv;.|.long in|
|000036e0| 74 65 6c 5f 6c 6f 6e 67 | 28 6c 6f 6e 67 20 6c 29 |tel_long|(long l)|
|000036f0| 0a 7b 0a 09 63 6f 6e 76 | 20 74 3b 0a 0a 09 74 2e |.{..conv| t;...t.|
|00003700| 62 5b 30 5d 20 3d 20 6c | 20 26 20 30 78 66 66 3b |b[0] = l| & 0xff;|
|00003710| 20 6c 20 3e 3e 3d 20 38 | 3b 0a 09 74 2e 62 5b 31 | l >>= 8|;..t.b[1|
|00003720| 5d 20 3d 20 6c 20 26 20 | 30 78 66 66 3b 20 6c 20 |] = l & |0xff; l |
|00003730| 3e 3e 3d 20 38 3b 0a 09 | 74 2e 62 5b 32 5d 20 3d |>>= 8;..|t.b[2] =|
|00003740| 20 6c 20 26 20 30 78 66 | 66 3b 20 6c 20 3e 3e 3d | l & 0xf|f; l >>=|
|00003750| 20 38 3b 0a 09 74 2e 62 | 5b 33 5d 20 3d 20 6c 20 | 8;..t.b|[3] = l |
|00003760| 26 20 30 78 66 66 3b 20 | 6c 20 3e 3e 3d 20 38 3b |& 0xff; |l >>= 8;|
|00003770| 0a 09 72 65 74 75 72 6e | 20 74 2e 6c 3b 0a 7d 0a |..return| t.l;.}.|
|00003780| 0a 73 68 6f 72 74 20 69 | 6e 74 65 6c 5f 73 68 6f |.short i|ntel_sho|
|00003790| 72 74 28 73 68 6f 72 74 | 20 6c 29 0a 7b 0a 09 63 |rt(short| l).{..c|
|000037a0| 6f 6e 76 20 74 3b 0a 0a | 09 74 2e 62 5b 30 5d 20 |onv t;..|.t.b[0] |
|000037b0| 3d 20 6c 20 26 20 30 78 | 66 66 3b 20 6c 20 3e 3e |= l & 0x|ff; l >>|
|000037c0| 3d 20 38 3b 0a 09 74 2e | 62 5b 31 5d 20 3d 20 6c |= 8;..t.|b[1] = l|
|000037d0| 20 26 20 30 78 66 66 3b | 20 6c 20 3e 3e 3d 20 38 | & 0xff;| l >>= 8|
|000037e0| 3b 0a 09 72 65 74 75 72 | 6e 20 74 2e 73 5b 30 5d |;..retur|n t.s[0]|
|000037f0| 3b 0a 7d 0a 0a 76 6f 69 | 64 20 64 69 65 28 63 68 |;.}..voi|d die(ch|
|00003800| 61 72 20 2a 20 73 74 72 | 29 0a 7b 0a 09 66 70 72 |ar * str|).{..fpr|
|00003810| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 22 25 73 5c |intf(std|err,"%s\|
|00003820| 6e 22 2c 73 74 72 29 3b | 0a 09 65 78 69 74 28 31 |n",str);|..exit(1|
|00003830| 29 3b 0a 7d 0a 0a 76 6f | 69 64 20 75 73 61 67 65 |);.}..vo|id usage|
|00003840| 28 76 6f 69 64 29 0a 7b | 0a 09 64 69 65 28 22 55 |(void).{|..die("U|
|00003850| 73 61 67 65 3a 20 62 75 | 69 6c 64 20 62 6f 6f 74 |sage: bu|ild boot|
|00003860| 73 65 63 74 20 73 65 74 | 75 70 22 29 3b 0a 7d 0a |sect set|up");.}.|
|00003870| 0a 69 6e 74 20 6d 61 69 | 6e 28 69 6e 74 20 61 72 |.int mai|n(int ar|
|00003880| 67 63 2c 20 63 68 61 72 | 20 2a 2a 20 61 72 67 76 |gc, char| ** argv|
|00003890| 29 0a 7b 0a 09 69 6e 74 | 20 69 2c 63 2c 69 64 2c |).{..int| i,c,id,|
|000038a0| 20 73 7a 3b 0a 09 75 6e | 73 69 67 6e 65 64 20 6c | sz;..un|signed l|
|000038b0| 6f 6e 67 20 73 79 73 5f | 73 69 7a 65 3b 0a 09 63 |ong sys_|size;..c|
|000038c0| 68 61 72 20 62 75 66 5b | 31 30 32 34 5d 3b 0a 09 |har buf[|1024];..|
|000038d0| 73 74 72 75 63 74 20 65 | 78 65 63 20 2a 65 78 20 |struct e|xec *ex |
|000038e0| 3d 20 28 73 74 72 75 63 | 74 20 65 78 65 63 20 2a |= (struc|t exec *|
|000038f0| 29 62 75 66 3b 0a 09 63 | 68 61 72 20 6d 61 6a 6f |)buf;..c|har majo|
|00003900| 72 5f 72 6f 6f 74 2c 20 | 6d 69 6e 6f 72 5f 72 6f |r_root, |minor_ro|
|00003910| 6f 74 3b 0a 09 73 74 72 | 75 63 74 20 73 74 61 74 |ot;..str|uct stat|
|00003920| 20 73 62 3b 0a 0a 09 69 | 66 20 28 61 72 67 63 20 | sb;...i|f (argc |
|00003930| 3c 20 33 29 20 7b 0a 09 | 09 75 73 61 67 65 28 29 |< 3) {..|.usage()|
|00003940| 3b 0a 09 7d 0a 09 66 6f | 72 20 28 69 3d 30 3b 69 |;..}..fo|r (i=0;i|
|00003950| 3c 73 69 7a 65 6f 66 20 | 62 75 66 3b 20 69 2b 2b |<sizeof |buf; i++|
|00003960| 29 20 62 75 66 5b 69 5d | 3d 30 3b 0a 09 69 66 20 |) buf[i]|=0;..if |
|00003970| 28 28 69 64 3d 6f 70 65 | 6e 28 61 72 67 76 5b 31 |((id=ope|n(argv[1|
|00003980| 5d 2c 4f 5f 52 44 4f 4e | 4c 59 2c 30 29 29 3c 30 |],O_RDON|LY,0))<0|
|00003990| 29 0a 09 09 64 69 65 28 | 22 55 6e 61 62 6c 65 20 |)...die(|"Unable |
|000039a0| 74 6f 20 6f 70 65 6e 20 | 27 62 6f 6f 74 27 22 29 |to open |'boot'")|
|000039b0| 3b 0a 09 69 66 20 28 72 | 65 61 64 28 69 64 2c 62 |;..if (r|ead(id,b|
|000039c0| 75 66 2c 4d 49 4e 49 58 | 5f 48 45 41 44 45 52 29 |uf,MINIX|_HEADER)|
|000039d0| 20 21 3d 20 4d 49 4e 49 | 58 5f 48 45 41 44 45 52 | != MINI|X_HEADER|
|000039e0| 29 0a 09 09 64 69 65 28 | 22 55 6e 61 62 6c 65 20 |)...die(|"Unable |
|000039f0| 74 6f 20 72 65 61 64 20 | 68 65 61 64 65 72 20 6f |to read |header o|
|00003a00| 66 20 27 62 6f 6f 74 27 | 22 29 3b 0a 09 69 66 20 |f 'boot'|");..if |
|00003a10| 28 28 28 6c 6f 6e 67 20 | 2a 29 20 62 75 66 29 5b |(((long |*) buf)[|
|00003a20| 30 5d 21 3d 69 6e 74 65 | 6c 5f 6c 6f 6e 67 28 30 |0]!=inte|l_long(0|
|00003a30| 78 30 34 31 30 30 33 30 | 31 29 29 0a 09 09 64 69 |x0410030|1))...di|
|00003a40| 65 28 22 4e 6f 6e 2d 4d | 69 6e 69 78 20 68 65 61 |e("Non-M|inix hea|
|00003a50| 64 65 72 20 6f 66 20 27 | 62 6f 6f 74 27 22 29 3b |der of '|boot'");|
|00003a60| 0a 09 69 66 20 28 28 28 | 6c 6f 6e 67 20 2a 29 20 |..if (((|long *) |
|00003a70| 62 75 66 29 5b 31 5d 21 | 3d 69 6e 74 65 6c 5f 6c |buf)[1]!|=intel_l|
|00003a80| 6f 6e 67 28 4d 49 4e 49 | 58 5f 48 45 41 44 45 52 |ong(MINI|X_HEADER|
|00003a90| 29 29 0a 09 09 64 69 65 | 28 22 4e 6f 6e 2d 4d 69 |))...die|("Non-Mi|
|00003aa0| 6e 69 78 20 68 65 61 64 | 65 72 20 6f 66 20 27 62 |nix head|er of 'b|
|00003ab0| 6f 6f 74 27 22 29 3b 0a | 09 69 66 20 28 28 28 6c |oot'");.|.if (((l|
|00003ac0| 6f 6e 67 20 2a 29 20 62 | 75 66 29 5b 33 5d 20 21 |ong *) b|uf)[3] !|
|00003ad0| 3d 20 30 29 0a 09 09 64 | 69 65 28 22 49 6c 6c 65 |= 0)...d|ie("Ille|
|00003ae0| 67 61 6c 20 64 61 74 61 | 20 73 65 67 6d 65 6e 74 |gal data| segment|
|00003af0| 20 69 6e 20 27 62 6f 6f | 74 27 22 29 3b 0a 09 69 | in 'boo|t'");..i|
|00003b00| 66 20 28 28 28 6c 6f 6e | 67 20 2a 29 20 62 75 66 |f (((lon|g *) buf|
|00003b10| 29 5b 34 5d 20 21 3d 20 | 30 29 0a 09 09 64 69 65 |)[4] != |0)...die|
|00003b20| 28 22 49 6c 6c 65 67 61 | 6c 20 62 73 73 20 69 6e |("Illega|l bss in|
|00003b30| 20 27 62 6f 6f 74 27 22 | 29 3b 0a 09 69 66 20 28 | 'boot'"|);..if (|
|00003b40| 28 28 6c 6f 6e 67 20 2a | 29 20 62 75 66 29 5b 35 |((long *|) buf)[5|
|00003b50| 5d 20 21 3d 20 30 29 0a | 09 09 64 69 65 28 22 4e |] != 0).|..die("N|
|00003b60| 6f 6e 2d 4d 69 6e 69 78 | 20 68 65 61 64 65 72 20 |on-Minix| header |
|00003b70| 6f 66 20 27 62 6f 6f 74 | 27 22 29 3b 0a 09 69 66 |of 'boot|'");..if|
|00003b80| 20 28 28 28 6c 6f 6e 67 | 20 2a 29 20 62 75 66 29 | (((long| *) buf)|
|00003b90| 5b 37 5d 20 21 3d 20 30 | 29 0a 09 09 64 69 65 28 |[7] != 0|)...die(|
|00003ba0| 22 49 6c 6c 65 67 61 6c | 20 73 79 6d 62 6f 6c 20 |"Illegal| symbol |
|00003bb0| 74 61 62 6c 65 20 69 6e | 20 27 62 6f 6f 74 27 22 |table in| 'boot'"|
|00003bc0| 29 3b 0a 09 69 3d 72 65 | 61 64 28 69 64 2c 62 75 |);..i=re|ad(id,bu|
|00003bd0| 66 2c 73 69 7a 65 6f 66 | 20 62 75 66 29 3b 0a 09 |f,sizeof| buf);..|
|00003be0| 66 70 72 69 6e 74 66 28 | 73 74 64 65 72 72 2c 22 |fprintf(|stderr,"|
|00003bf0| 42 6f 6f 74 20 73 65 63 | 74 6f 72 20 25 64 20 62 |Boot sec|tor %d b|
|00003c00| 79 74 65 73 2e 5c 6e 22 | 2c 69 29 3b 0a 09 69 66 |ytes.\n"|,i);..if|
|00003c10| 20 28 69 20 21 3d 20 35 | 31 32 29 0a 09 09 64 69 | (i != 5|12)...di|
|00003c20| 65 28 22 42 6f 6f 74 20 | 62 6c 6f 63 6b 20 6d 75 |e("Boot |block mu|
|00003c30| 73 74 20 62 65 20 65 78 | 61 63 74 6c 79 20 35 31 |st be ex|actly 51|
|00003c40| 32 20 62 79 74 65 73 22 | 29 3b 0a 09 69 3d 77 72 |2 bytes"|);..i=wr|
|00003c50| 69 74 65 28 31 2c 62 75 | 66 2c 35 31 32 29 3b 0a |ite(1,bu|f,512);.|
|00003c60| 09 69 66 20 28 69 21 3d | 35 31 32 29 0a 09 09 64 |.if (i!=|512)...d|
|00003c70| 69 65 28 22 57 72 69 74 | 65 20 63 61 6c 6c 20 66 |ie("Writ|e call f|
|00003c80| 61 69 6c 65 64 22 29 3b | 0a 09 63 6c 6f 73 65 20 |ailed");|..close |
|00003c90| 28 69 64 29 3b 0a 09 0a | 09 69 66 20 28 28 69 64 |(id);...|.if ((id|
|00003ca0| 3d 6f 70 65 6e 28 61 72 | 67 76 5b 32 5d 2c 4f 5f |=open(ar|gv[2],O_|
|00003cb0| 52 44 4f 4e 4c 59 2c 30 | 29 29 3c 30 29 0a 09 09 |RDONLY,0|))<0)...|
|00003cc0| 64 69 65 28 22 55 6e 61 | 62 6c 65 20 74 6f 20 6f |die("Una|ble to o|
|00003cd0| 70 65 6e 20 27 73 65 74 | 75 70 27 22 29 3b 0a 09 |pen 'set|up'");..|
|00003ce0| 69 66 20 28 72 65 61 64 | 28 69 64 2c 62 75 66 2c |if (read|(id,buf,|
|00003cf0| 4d 49 4e 49 58 5f 48 45 | 41 44 45 52 29 20 21 3d |MINIX_HE|ADER) !=|
|00003d00| 20 4d 49 4e 49 58 5f 48 | 45 41 44 45 52 29 0a 09 | MINIX_H|EADER)..|
|00003d10| 09 64 69 65 28 22 55 6e | 61 62 6c 65 20 74 6f 20 |.die("Un|able to |
|00003d20| 72 65 61 64 20 68 65 61 | 64 65 72 20 6f 66 20 27 |read hea|der of '|
|00003d30| 73 65 74 75 70 27 22 29 | 3b 0a 09 69 66 20 28 28 |setup'")|;..if ((|
|00003d40| 28 6c 6f 6e 67 20 2a 29 | 20 62 75 66 29 5b 30 5d |(long *)| buf)[0]|
|00003d50| 21 3d 69 6e 74 65 6c 5f | 6c 6f 6e 67 28 30 78 30 |!=intel_|long(0x0|
|00003d60| 34 31 30 30 33 30 31 29 | 29 0a 09 09 64 69 65 28 |4100301)|)...die(|
|00003d70| 22 4e 6f 6e 2d 4d 69 6e | 69 78 20 68 65 61 64 65 |"Non-Min|ix heade|
|00003d80| 72 20 6f 66 20 27 73 65 | 74 75 70 27 22 29 3b 0a |r of 'se|tup'");.|
|00003d90| 09 69 66 20 28 28 28 6c | 6f 6e 67 20 2a 29 20 62 |.if (((l|ong *) b|
|00003da0| 75 66 29 5b 31 5d 21 3d | 69 6e 74 65 6c 5f 6c 6f |uf)[1]!=|intel_lo|
|00003db0| 6e 67 28 4d 49 4e 49 58 | 5f 48 45 41 44 45 52 29 |ng(MINIX|_HEADER)|
|00003dc0| 29 0a 09 09 64 69 65 28 | 22 4e 6f 6e 2d 4d 69 6e |)...die(|"Non-Min|
|00003dd0| 69 78 20 68 65 61 64 65 | 72 20 6f 66 20 27 73 65 |ix heade|r of 'se|
|00003de0| 74 75 70 27 22 29 3b 0a | 09 69 66 20 28 28 28 6c |tup'");.|.if (((l|
|00003df0| 6f 6e 67 20 2a 29 20 62 | 75 66 29 5b 33 5d 20 21 |ong *) b|uf)[3] !|
|00003e00| 3d 20 30 29 0a 09 09 64 | 69 65 28 22 49 6c 6c 65 |= 0)...d|ie("Ille|
|00003e10| 67 61 6c 20 64 61 74 61 | 20 73 65 67 6d 65 6e 74 |gal data| segment|
|00003e20| 20 69 6e 20 27 73 65 74 | 75 70 27 22 29 3b 0a 09 | in 'set|up'");..|
|00003e30| 69 66 20 28 28 28 6c 6f | 6e 67 20 2a 29 20 62 75 |if (((lo|ng *) bu|
|00003e40| 66 29 5b 34 5d 20 21 3d | 20 30 29 0a 09 09 64 69 |f)[4] !=| 0)...di|
|00003e50| 65 28 22 49 6c 6c 65 67 | 61 6c 20 62 73 73 20 69 |e("Illeg|al bss i|
|00003e60| 6e 20 27 73 65 74 75 70 | 27 22 29 3b 0a 09 69 66 |n 'setup|'");..if|
|00003e70| 20 28 28 28 6c 6f 6e 67 | 20 2a 29 20 62 75 66 29 | (((long| *) buf)|
|00003e80| 5b 35 5d 20 21 3d 20 30 | 29 0a 09 09 64 69 65 28 |[5] != 0|)...die(|
|00003e90| 22 4e 6f 6e 2d 4d 69 6e | 69 78 20 68 65 61 64 65 |"Non-Min|ix heade|
|00003ea0| 72 20 6f 66 20 27 73 65 | 74 75 70 27 22 29 3b 0a |r of 'se|tup'");.|
|00003eb0| 09 69 66 20 28 28 28 6c | 6f 6e 67 20 2a 29 20 62 |.if (((l|ong *) b|
|00003ec0| 75 66 29 5b 37 5d 20 21 | 3d 20 30 29 0a 09 09 64 |uf)[7] !|= 0)...d|
|00003ed0| 69 65 28 22 49 6c 6c 65 | 67 61 6c 20 73 79 6d 62 |ie("Ille|gal symb|
|00003ee0| 6f 6c 20 74 61 62 6c 65 | 20 69 6e 20 27 73 65 74 |ol table| in 'set|
|00003ef0| 75 70 27 22 29 3b 0a 09 | 66 6f 72 20 28 69 3d 30 |up'");..|for (i=0|
|00003f00| 20 3b 20 28 63 3d 72 65 | 61 64 28 69 64 2c 62 75 | ; (c=re|ad(id,bu|
|00003f10| 66 2c 73 69 7a 65 6f 66 | 20 62 75 66 29 29 3e 30 |f,sizeof| buf))>0|
|00003f20| 20 3b 20 69 2b 3d 63 20 | 29 0a 09 09 69 66 20 28 | ; i+=c |)...if (|
|00003f30| 77 72 69 74 65 28 31 2c | 62 75 66 2c 63 29 21 3d |write(1,|buf,c)!=|
|00003f40| 63 29 0a 09 09 09 64 69 | 65 28 22 57 72 69 74 65 |c)....di|e("Write|
|00003f50| 20 63 61 6c 6c 20 66 61 | 69 6c 65 64 22 29 3b 0a | call fa|iled");.|
|00003f60| 09 69 66 20 28 63 20 21 | 3d 20 30 29 0a 09 09 64 |.if (c !|= 0)...d|
|00003f70| 69 65 28 22 72 65 61 64 | 2d 65 72 72 6f 72 20 6f |ie("read|-error o|
|00003f80| 6e 20 27 73 65 74 75 70 | 27 22 29 3b 0a 09 63 6c |n 'setup|'");..cl|
|00003f90| 6f 73 65 20 28 69 64 29 | 3b 0a 09 69 66 20 28 69 |ose (id)|;..if (i|
|00003fa0| 20 3e 20 53 45 54 55 50 | 53 45 43 53 2a 35 31 32 | > SETUP|SECS*512|
|00003fb0| 29 0a 09 09 64 69 65 28 | 22 53 65 74 75 70 20 65 |)...die(|"Setup e|
|00003fc0| 78 63 65 65 64 73 20 22 | 20 53 54 52 49 4e 47 49 |xceeds "| STRINGI|
|00003fd0| 46 59 28 53 45 54 55 50 | 53 45 43 53 29 0a 09 09 |FY(SETUP|SECS)...|
|00003fe0| 09 22 20 73 65 63 74 6f | 72 73 20 2d 20 72 65 77 |." secto|rs - rew|
|00003ff0| 72 69 74 65 20 62 75 69 | 6c 64 2f 62 6f 6f 74 2f |rite bui|ld/boot/|
|00004000| 73 65 74 75 70 22 29 3b | 0a 09 66 70 72 69 6e 74 |setup");|..fprint|
|00004010| 66 28 73 74 64 65 72 72 | 2c 22 53 65 74 75 70 20 |f(stderr|,"Setup |
|00004020| 69 73 20 25 64 20 62 79 | 74 65 73 2e 5c 6e 22 2c |is %d by|tes.\n",|
|00004030| 69 29 3b 0a 09 66 6f 72 | 20 28 63 3d 30 20 3b 20 |i);..for| (c=0 ; |
|00004040| 63 3c 73 69 7a 65 6f 66 | 28 62 75 66 29 20 3b 20 |c<sizeof|(buf) ; |
|00004050| 63 2b 2b 29 0a 09 09 62 | 75 66 5b 63 5d 20 3d 20 |c++)...b|uf[c] = |
|00004060| 27 5c 30 27 3b 0a 09 77 | 68 69 6c 65 20 28 69 3c |'\0';..w|hile (i<|
|00004070| 53 45 54 55 50 53 45 43 | 53 2a 35 31 32 29 20 7b |SETUPSEC|S*512) {|
|00004080| 0a 09 09 63 20 3d 20 53 | 45 54 55 50 53 45 43 53 |...c = S|ETUPSECS|
|00004090| 2a 35 31 32 2d 69 3b 0a | 09 09 69 66 20 28 63 20 |*512-i;.|..if (c |
|000040a0| 3e 20 73 69 7a 65 6f 66 | 28 62 75 66 29 29 0a 09 |> sizeof|(buf))..|
|000040b0| 09 09 63 20 3d 20 73 69 | 7a 65 6f 66 28 62 75 66 |..c = si|zeof(buf|
|000040c0| 29 3b 0a 09 09 69 66 20 | 28 77 72 69 74 65 28 31 |);...if |(write(1|
|000040d0| 2c 62 75 66 2c 63 29 20 | 21 3d 20 63 29 0a 09 09 |,buf,c) |!= c)...|
|000040e0| 09 64 69 65 28 22 57 72 | 69 74 65 20 63 61 6c 6c |.die("Wr|ite call|
|000040f0| 20 66 61 69 6c 65 64 22 | 29 3b 0a 09 09 69 20 2b | failed"|);...i +|
|00004100| 3d 20 63 3b 0a 09 7d 0a | 09 0a 09 69 66 20 28 28 |= c;..}.|...if ((|
|00004110| 69 64 3d 6f 70 65 6e 28 | 61 72 67 76 5b 33 5d 2c |id=open(|argv[3],|
|00004120| 4f 5f 52 44 4f 4e 4c 59 | 2c 30 29 29 3c 30 29 0a |O_RDONLY|,0))<0).|
|00004130| 09 09 64 69 65 28 22 55 | 6e 61 62 6c 65 20 74 6f |..die("U|nable to|
|00004140| 20 6f 70 65 6e 20 27 73 | 65 74 75 70 27 22 29 3b | open 's|etup'");|
|00004150| 0a 23 69 66 6e 64 65 66 | 20 45 4c 46 0a 09 69 66 |.#ifndef| ELF..if|
|00004160| 20 28 72 65 61 64 28 69 | 64 2c 62 75 66 2c 47 43 | (read(i|d,buf,GC|
|00004170| 43 5f 48 45 41 44 45 52 | 29 20 21 3d 20 47 43 43 |C_HEADER|) != GCC|
|00004180| 5f 48 45 41 44 45 52 29 | 0a 09 09 64 69 65 28 22 |_HEADER)|...die("|
|00004190| 55 6e 61 62 6c 65 20 74 | 6f 20 72 65 61 64 20 68 |Unable t|o read h|
|000041a0| 65 61 64 65 72 20 6f 66 | 20 27 74 65 73 74 27 22 |eader of| 'test'"|
|000041b0| 29 3b 0a 20 20 20 20 20 | 20 20 20 69 66 20 28 4e |);. | if (N|
|000041c0| 5f 4d 41 47 49 43 28 2a | 65 78 29 20 3d 3d 20 5a |_MAGIC(*|ex) == Z|
|000041d0| 4d 41 47 49 43 29 20 7b | 0a 20 20 20 20 20 20 20 |MAGIC) {|. |
|000041e0| 20 20 20 20 20 20 20 20 | 20 47 43 43 5f 48 45 41 | | GCC_HEA|
|000041f0| 44 45 52 20 3d 20 4e 5f | 4d 41 47 49 43 5f 4f 46 |DER = N_|MAGIC_OF|
|00004200| 46 53 45 54 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |FSET;. | |
|00004210| 20 20 20 20 20 20 6c 73 | 65 65 6b 28 69 64 2c 20 | ls|eek(id, |
|00004220| 47 43 43 5f 48 45 41 44 | 45 52 2c 20 53 45 45 4b |GCC_HEAD|ER, SEEK|
|00004230| 5f 53 45 54 29 3b 0a 20 | 20 20 20 20 20 20 20 7d |_SET);. | }|
|00004240| 20 65 6c 73 65 20 69 66 | 20 28 4e 5f 4d 41 47 49 | else if| (N_MAGI|
|00004250| 43 28 2a 65 78 29 20 21 | 3d 20 51 4d 41 47 49 43 |C(*ex) !|= QMAGIC|
|00004260| 29 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |). | |
|00004270| 20 20 64 69 65 28 22 4e | 6f 6e 2d 47 43 43 20 68 | die("N|on-GCC h|
|00004280| 65 61 64 65 72 20 6f 66 | 20 27 74 65 73 74 27 22 |eader of| 'test'"|
|00004290| 29 3b 0a 09 66 70 72 69 | 6e 74 66 28 73 74 64 65 |);..fpri|ntf(stde|
|000042a0| 72 72 2c 22 54 65 73 74 | 20 69 73 20 25 64 20 6b |rr,"Test| is %d k|
|000042b0| 42 20 28 25 64 20 6b 42 | 20 63 6f 64 65 2c 20 25 |B (%d kB| code, %|
|000042c0| 64 20 6b 42 20 64 61 74 | 61 20 61 6e 64 20 25 64 |d kB dat|a and %d|
|000042d0| 20 6b 42 20 62 73 73 29 | 5c 6e 22 2c 0a 09 09 28 | kB bss)|\n",...(|
|000042e0| 65 78 2d 3e 61 5f 74 65 | 78 74 2b 65 78 2d 3e 61 |ex->a_te|xt+ex->a|
|000042f0| 5f 64 61 74 61 2b 65 78 | 2d 3e 61 5f 62 73 73 29 |_data+ex|->a_bss)|
|00004300| 2f 31 30 32 34 2c 0a 09 | 09 65 78 2d 3e 61 5f 74 |/1024,..|.ex->a_t|
|00004310| 65 78 74 20 2f 31 30 32 | 34 2c 0a 09 09 65 78 2d |ext /102|4,...ex-|
|00004320| 3e 61 5f 64 61 74 61 20 | 2f 31 30 32 34 2c 0a 09 |>a_data |/1024,..|
|00004330| 09 65 78 2d 3e 61 5f 62 | 73 73 20 20 2f 31 30 32 |.ex->a_b|ss /102|
|00004340| 34 29 3b 0a 09 73 7a 20 | 3d 20 4e 5f 53 59 4d 4f |4);..sz |= N_SYMO|
|00004350| 46 46 28 2a 65 78 29 20 | 2d 20 47 43 43 5f 48 45 |FF(*ex) |- GCC_HE|
|00004360| 41 44 45 52 20 2b 20 34 | 3b 0a 23 65 6c 73 65 0a |ADER + 4|;.#else.|
|00004370| 20 20 20 20 20 20 20 20 | 69 66 20 28 66 73 74 61 | |if (fsta|
|00004380| 74 20 28 69 64 2c 20 26 | 73 62 29 29 20 7b 0a 20 |t (id, &|sb)) {. |
|00004390| 20 20 20 20 20 20 20 20 | 20 70 65 72 72 6f 72 20 | | perror |
|000043a0| 28 22 66 73 74 61 74 22 | 29 3b 0a 20 20 20 20 20 |("fstat"|);. |
|000043b0| 20 20 20 20 20 64 69 65 | 20 28 22 55 6e 61 62 6c | die| ("Unabl|
|000043c0| 65 20 74 6f 20 73 74 61 | 74 20 27 74 65 73 74 27 |e to sta|t 'test'|
|000043d0| 22 29 3b 0a 20 20 20 20 | 20 20 20 20 7d 0a 20 20 |");. | }. |
|000043e0| 20 20 20 20 20 20 73 7a | 20 3d 20 73 62 2e 73 74 | sz| = sb.st|
|000043f0| 5f 73 69 7a 65 3b 0a 20 | 20 20 20 20 20 20 20 66 |_size;. | f|
|00004400| 70 72 69 6e 74 66 20 28 | 73 74 64 65 72 72 2c 20 |printf (|stderr, |
|00004410| 22 54 65 73 74 20 69 73 | 20 25 64 20 6b 42 5c 6e |"Test is| %d kB\n|
|00004420| 22 2c 20 73 7a 2f 31 30 | 32 34 29 3b 0a 09 73 79 |", sz/10|24);..sy|
|00004430| 73 5f 73 69 7a 65 20 3d | 20 28 73 7a 20 2b 20 31 |s_size =| (sz + 1|
|00004440| 35 29 20 2f 20 31 36 3b | 0a 09 69 66 20 28 73 79 |5) / 16;|..if (sy|
|00004450| 73 5f 73 69 7a 65 20 3e | 20 54 53 54 53 49 5a 45 |s_size >| TSTSIZE|
|00004460| 29 0a 09 09 64 69 65 28 | 22 54 65 73 74 20 69 73 |)...die(|"Test is|
|00004470| 20 74 6f 6f 20 62 69 67 | 22 29 3b 0a 23 65 6e 64 | too big|");.#end|
|00004480| 69 66 0a 09 77 68 69 6c | 65 20 28 73 7a 20 3e 20 |if..whil|e (sz > |
|00004490| 30 29 20 7b 0a 09 09 69 | 6e 74 20 6c 2c 20 6e 3b |0) {...i|nt l, n;|
|000044a0| 0a 0a 09 09 6c 20 3d 20 | 73 7a 3b 0a 09 09 69 66 |....l = |sz;...if|
|000044b0| 20 28 6c 20 3e 20 73 69 | 7a 65 6f 66 28 62 75 66 | (l > si|zeof(buf|
|000044c0| 29 29 0a 09 09 09 6c 20 | 3d 20 73 69 7a 65 6f 66 |))....l |= sizeof|
|000044d0| 28 62 75 66 29 3b 0a 09 | 09 69 66 20 28 28 6e 3d |(buf);..|.if ((n=|
|000044e0| 72 65 61 64 28 69 64 2c | 20 62 75 66 2c 20 6c 29 |read(id,| buf, l)|
|000044f0| 29 20 21 3d 20 6c 29 20 | 7b 0a 09 09 09 69 66 20 |) != l) |{....if |
|00004500| 28 6e 20 3d 3d 20 2d 31 | 29 20 0a 09 09 09 09 70 |(n == -1|) .....p|
|00004510| 65 72 72 6f 72 28 61 72 | 67 76 5b 31 5d 29 3b 0a |error(ar|gv[1]);.|
|00004520| 09 09 09 65 6c 73 65 0a | 09 09 09 09 66 70 72 69 |...else.|....fpri|
|00004530| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 55 6e 65 |ntf(stde|rr, "Une|
|00004540| 78 70 65 63 74 65 64 20 | 45 4f 46 5c 6e 22 29 3b |xpected |EOF\n");|
|00004550| 0a 09 09 09 64 69 65 28 | 22 43 61 6e 27 74 20 72 |....die(|"Can't r|
|00004560| 65 61 64 20 27 74 65 73 | 74 27 22 29 3b 0a 09 09 |ead 'tes|t'");...|
|00004570| 7d 0a 09 09 69 66 20 28 | 77 72 69 74 65 28 31 2c |}...if (|write(1,|
|00004580| 20 62 75 66 2c 20 6c 29 | 20 21 3d 20 6c 29 0a 09 | buf, l)| != l)..|
|00004590| 09 09 64 69 65 28 22 57 | 72 69 74 65 20 66 61 69 |..die("W|rite fai|
|000045a0| 6c 65 64 22 29 3b 0a 09 | 09 73 7a 20 2d 3d 20 6c |led");..|.sz -= l|
|000045b0| 3b 0a 09 7d 0a 0a 09 63 | 6c 6f 73 65 28 69 64 29 |;..}...c|lose(id)|
|000045c0| 3b 0a 09 69 66 20 28 6c | 73 65 65 6b 28 31 2c 35 |;..if (l|seek(1,5|
|000045d0| 30 30 2c 30 29 20 3d 3d | 20 35 30 30 29 20 7b 0a |00,0) ==| 500) {.|
|000045e0| 09 09 62 75 66 5b 30 5d | 20 3d 20 28 73 79 73 5f |..buf[0]| = (sys_|
|000045f0| 73 69 7a 65 20 26 20 30 | 78 66 66 29 3b 0a 09 09 |size & 0|xff);...|
|00004600| 62 75 66 5b 31 5d 20 3d | 20 28 28 73 79 73 5f 73 |buf[1] =| ((sys_s|
|00004610| 69 7a 65 20 3e 3e 20 38 | 29 20 26 20 30 78 66 66 |ize >> 8|) & 0xff|
|00004620| 29 3b 0a 09 09 69 66 20 | 28 77 72 69 74 65 28 31 |);...if |(write(1|
|00004630| 2c 20 62 75 66 2c 20 32 | 29 20 21 3d 20 32 29 0a |, buf, 2|) != 2).|
|00004640| 09 09 09 64 69 65 28 22 | 57 72 69 74 65 20 66 61 |...die("|Write fa|
|00004650| 69 6c 65 64 22 29 3b 0a | 09 7d 0a 09 72 65 74 75 |iled");.|.}..retu|
|00004660| 72 6e 28 30 29 3b 0a 7d | 0a 00 00 00 00 00 00 00 |rn(0);.}|........|
|00004670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004680| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004690| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004800| 6d 65 6d 74 65 73 74 38 | 36 2f 68 65 61 64 2e 53 |memtest8|6/head.S|
|00004810| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004860| 00 00 00 00 31 30 30 37 | 35 35 20 00 20 32 30 32 |....1007|55 . 202|
|00004870| 35 32 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |52 . | 0 . |
|00004880| 20 20 20 33 32 33 33 20 | 20 36 31 34 30 30 30 37 | 3233 | 6140007|
|00004890| 34 30 37 20 20 31 32 34 | 31 34 00 20 30 00 00 00 |407 124|14. 0...|
|000048a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004900| 00 75 73 74 61 72 20 20 | 00 63 62 72 61 64 79 00 |.ustar |.cbrady.|
|00004910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004920| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00004930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a00| 2f 2a 0a 20 2a 20 20 6c | 69 6e 75 78 2f 62 6f 6f |/*. * l|inux/boo|
|00004a10| 74 2f 68 65 61 64 2e 53 | 0a 20 2a 20 20 43 6f 70 |t/head.S|. * Cop|
|00004a20| 79 72 69 67 68 74 20 28 | 43 29 20 31 39 39 31 2c |yright (|C) 1991,|
|00004a30| 20 31 39 39 32 20 20 4c | 69 6e 75 73 20 54 6f 72 | 1992 L|inus Tor|
|00004a40| 76 61 6c 64 73 0a 20 2a | 2f 0a 0a 2f 2a 0a 20 2a |valds. *|/../*. *|
|00004a50| 20 20 68 65 61 64 2e 53 | 20 63 6f 6e 74 61 69 6e | head.S| contain|
|00004a60| 73 20 74 68 65 20 33 32 | 2d 62 69 74 20 73 74 61 |s the 32|-bit sta|
|00004a70| 72 74 75 70 20 63 6f 64 | 65 2e 0a 20 2a 0a 20 2a |rtup cod|e.. *. *|
|00004a80| 20 20 31 2d 4a 61 6e 2d | 39 36 20 4d 6f 64 69 66 | 1-Jan-|96 Modif|
|00004a90| 69 65 64 20 62 79 20 43 | 68 72 69 73 20 42 72 61 |ied by C|hris Bra|
|00004aa0| 64 79 20 66 6f 72 20 75 | 73 65 20 61 73 20 61 20 |dy for u|se as a |
|00004ab0| 62 6f 6f 74 2f 6c 6f 61 | 64 65 72 20 66 6f 72 20 |boot/loa|der for |
|00004ac0| 4d 65 6d 54 65 73 74 2d | 38 36 2e 0a 20 2a 20 20 |MemTest-|86.. * |
|00004ad0| 53 65 74 75 70 20 74 68 | 65 20 6d 65 6d 6f 72 79 |Setup th|e memory|
|00004ae0| 20 6d 61 6e 61 67 65 6d | 65 6e 74 20 66 6f 72 20 | managem|ent for |
|00004af0| 66 6c 61 74 20 6e 6f 6e | 2d 70 61 67 65 64 20 6c |flat non|-paged l|
|00004b00| 69 6e 65 61 72 20 61 64 | 64 72 65 73 73 69 6e 67 |inear ad|dressing|
|00004b10| 2e 0a 20 2a 2f 0a 0a 2e | 74 65 78 74 0a 0a 23 69 |.. */...|text..#i|
|00004b20| 6e 63 6c 75 64 65 20 3c | 6c 69 6e 75 78 2f 6c 69 |nclude <|linux/li|
|00004b30| 6e 6b 61 67 65 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |nkage.h>|.#includ|
|00004b40| 65 20 22 6d 74 65 73 74 | 2e 68 22 0a 0a 23 69 66 |e "mtest|.h"..#if|
|00004b50| 6e 64 65 66 20 53 59 4d | 42 4f 4c 5f 4e 41 4d 45 |ndef SYM|BOL_NAME|
|00004b60| 0a 23 64 65 66 69 6e 65 | 20 53 59 4d 42 4f 4c 5f |.#define| SYMBOL_|
|00004b70| 4e 41 4d 45 28 58 29 20 | 5f 2f 2a 2a 2f 58 0a 23 |NAME(X) |_/**/X.#|
|00004b80| 65 6e 64 69 66 0a 0a 2e | 67 6c 6f 62 6c 20 53 59 |endif...|globl SY|
|00004b90| 4d 42 4f 4c 5f 4e 41 4d | 45 28 6d 65 6d 73 7a 29 |MBOL_NAM|E(memsz)|
|00004ba0| 0a 0a 73 74 61 72 74 75 | 70 5f 33 32 3a 0a 09 63 |..startu|p_32:..c|
|00004bb0| 6c 64 0a 09 63 6c 69 0a | 09 6d 6f 76 6c 20 24 28 |ld..cli.|.movl $(|
|00004bc0| 4b 45 52 4e 45 4c 5f 44 | 53 29 2c 25 65 61 78 0a |KERNEL_D|S),%eax.|
|00004bd0| 09 6d 6f 76 20 25 61 78 | 2c 25 64 73 0a 09 6d 6f |.mov %ax|,%ds..mo|
|00004be0| 76 20 25 61 78 2c 25 65 | 73 0a 09 6d 6f 76 20 25 |v %ax,%e|s..mov %|
|00004bf0| 61 78 2c 25 66 73 0a 09 | 6d 6f 76 20 25 61 78 2c |ax,%fs..|mov %ax,|
|00004c00| 25 67 73 0a 09 6d 6f 76 | 20 25 61 78 2c 25 73 73 |%gs..mov| %ax,%ss|
|00004c10| 0a 09 6d 6f 76 20 24 28 | 54 45 53 54 41 44 52 29 |..mov $(|TESTADR)|
|00004c20| 2c 25 65 73 70 0a 2f 2a | 0a 20 2a 20 73 74 61 72 |,%esp./*|. * star|
|00004c30| 74 20 73 79 73 74 65 6d | 20 33 32 2d 62 69 74 20 |t system| 32-bit |
|00004c40| 73 65 74 75 70 2e 20 57 | 65 20 6e 65 65 64 20 74 |setup. W|e need t|
|00004c50| 6f 20 72 65 2d 64 6f 20 | 73 6f 6d 65 20 6f 66 20 |o re-do |some of |
|00004c60| 74 68 65 20 74 68 69 6e | 67 73 20 64 6f 6e 65 0a |the thin|gs done.|
|00004c70| 20 2a 20 69 6e 20 31 36 | 2d 62 69 74 20 6d 6f 64 | * in 16|-bit mod|
|00004c80| 65 20 66 6f 72 20 74 68 | 65 20 22 72 65 61 6c 22 |e for th|e "real"|
|00004c90| 20 6f 70 65 72 61 74 69 | 6f 6e 73 2e 0a 20 2a 2f | operati|ons.. */|
|00004ca0| 0a 09 78 6f 72 6c 20 25 | 65 61 78 2c 25 65 61 78 |..xorl %|eax,%eax|
|00004cb0| 0a 61 32 30 3a 09 69 6e | 63 6c 20 25 65 61 78 09 |.a20:.in|cl %eax.|
|00004cc0| 09 23 20 63 68 65 63 6b | 20 74 68 61 74 20 41 32 |.# check| that A2|
|00004cd0| 30 20 72 65 61 6c 6c 79 | 20 49 53 20 65 6e 61 62 |0 really| IS enab|
|00004ce0| 6c 65 64 0a 09 6d 6f 76 | 6c 20 25 65 61 78 2c 30 |led..mov|l %eax,0|
|00004cf0| 78 30 30 30 30 30 30 09 | 23 20 6c 6f 6f 70 20 66 |x000000.|# loop f|
|00004d00| 6f 72 65 76 65 72 20 69 | 66 20 69 74 20 69 73 6e |orever i|f it isn|
|00004d10| 27 74 0a 09 63 6d 70 6c | 20 25 65 61 78 2c 30 78 |'t..cmpl| %eax,0x|
|00004d20| 31 30 30 30 30 30 0a 09 | 6a 65 20 61 32 30 0a 2f |100000..|je a20./|
|00004d30| 2a 0a 20 2a 20 63 6f 70 | 79 20 74 68 65 20 6d 65 |*. * cop|y the me|
|00004d40| 6d 6f 72 79 20 73 69 7a | 65 20 76 61 6c 75 65 20 |mory siz|e value |
|00004d50| 0a 20 2a 2f 0a 09 6d 6f | 76 77 20 28 30 78 39 30 |. */..mo|vw (0x90|
|00004d60| 30 30 30 29 2c 25 61 78 | 0a 09 6d 6f 76 77 20 25 |000),%ax|..movw %|
|00004d70| 61 78 2c 53 59 4d 42 4f | 4c 5f 4e 41 4d 45 28 6d |ax,SYMBO|L_NAME(m|
|00004d80| 65 6d 73 7a 29 0a 0a 20 | 20 20 20 20 20 20 20 6c |emsz).. | l|
|00004d90| 67 64 74 20 67 64 74 5f | 64 65 73 63 72 0a 20 20 |gdt gdt_|descr. |
|00004da0| 20 20 20 20 20 20 6c 6a | 6d 70 20 24 28 4b 45 52 | lj|mp $(KER|
|00004db0| 4e 45 4c 5f 43 53 29 2c | 24 66 6c 75 73 68 0a 66 |NEL_CS),|$flush.f|
|00004dc0| 6c 75 73 68 3a 20 20 6d | 6f 76 6c 20 24 28 4b 45 |lush: m|ovl $(KE|
|00004dd0| 52 4e 45 4c 5f 44 53 29 | 2c 25 65 61 78 20 20 23 |RNEL_DS)|,%eax #|
|00004de0| 20 72 65 6c 6f 61 64 20 | 61 6c 6c 20 74 68 65 20 | reload |all the |
|00004df0| 73 65 67 6d 65 6e 74 20 | 72 65 67 69 73 74 65 72 |segment |register|
|00004e00| 73 0a 20 20 20 20 20 20 | 20 20 6d 6f 76 20 25 61 |s. | mov %a|
|00004e10| 78 2c 25 64 73 20 20 20 | 20 20 20 20 20 20 20 20 |x,%ds | |
|00004e20| 20 20 23 20 61 66 74 65 | 72 20 63 68 61 6e 67 69 | # afte|r changi|
|00004e30| 6e 67 20 67 64 74 2e 0a | 20 20 20 20 20 20 20 20 |ng gdt..| |
|00004e40| 6d 6f 76 20 25 61 78 2c | 25 65 73 0a 20 20 20 20 |mov %ax,|%es. |
|00004e50| 20 20 20 20 6d 6f 76 20 | 25 61 78 2c 25 66 73 0a | mov |%ax,%fs.|
|00004e60| 20 20 20 20 20 20 20 20 | 6d 6f 76 20 25 61 78 2c | |mov %ax,|
|00004e70| 25 67 73 0a 09 6d 6f 76 | 20 25 61 78 2c 25 73 73 |%gs..mov| %ax,%ss|
|00004e80| 0a 0a 20 20 20 20 20 20 | 20 20 63 61 6c 6c 20 53 |.. | call S|
|00004e90| 59 4d 42 4f 4c 5f 4e 41 | 4d 45 28 64 6f 5f 74 65 |YMBOL_NA|ME(do_te|
|00004ea0| 73 74 29 0a 0a 67 64 74 | 5f 64 65 73 63 72 3a 0a |st)..gdt|_descr:.|
|00004eb0| 20 20 20 20 20 20 20 20 | 2e 77 6f 72 64 20 28 31 | |.word (1|
|00004ec0| 36 29 2a 38 2d 31 0a 20 | 20 20 20 20 20 20 20 2e |6)*8-1. | .|
|00004ed0| 6c 6f 6e 67 20 5f 67 64 | 74 0a 0a 2e 61 6c 69 67 |long _gd|t...alig|
|00004ee0| 6e 20 34 0a 5f 67 64 74 | 3a 0a 20 20 20 20 20 20 |n 4._gdt|:. |
|00004ef0| 20 20 2e 71 75 61 64 20 | 30 78 30 30 30 30 30 30 | .quad |0x000000|
|00004f00| 30 30 30 30 30 30 30 30 | 30 30 20 20 20 20 20 20 |00000000|00 |
|00004f10| 20 20 2f 2a 20 4e 55 4c | 4c 20 64 65 73 63 72 69 | /* NUL|L descri|
|00004f20| 70 74 6f 72 20 2a 2f 0a | 20 20 20 20 20 20 20 20 |ptor */.| |
|00004f30| 2e 71 75 61 64 20 30 78 | 30 30 30 30 30 30 30 30 |.quad 0x|00000000|
|00004f40| 30 30 30 30 30 30 30 30 | 20 20 20 20 20 20 20 20 |00000000| |
|00004f50| 2f 2a 20 6e 6f 74 20 75 | 73 65 64 20 2a 2f 0a 20 |/* not u|sed */. |
|00004f60| 20 20 20 20 20 20 20 2e | 71 75 61 64 20 30 78 30 | .|quad 0x0|
|00004f70| 30 63 30 39 61 30 30 30 | 30 30 30 66 66 66 66 20 |0c09a000|000ffff |
|00004f80| 20 20 20 20 20 20 20 2f | 2a 20 30 78 31 30 20 6d | /|* 0x10 m|
|00004f90| 61 69 6e 20 32 35 36 6d | 62 20 63 6f 64 65 20 61 |ain 256m|b code a|
|00004fa0| 74 20 30 78 30 30 30 30 | 30 30 20 2a 2f 0a 20 20 |t 0x0000|00 */. |
|00004fb0| 20 20 20 20 20 20 2e 71 | 75 61 64 20 30 78 30 30 | .q|uad 0x00|
|00004fc0| 63 30 39 32 30 30 30 30 | 30 30 66 66 66 66 20 20 |c0920000|00ffff |
|00004fd0| 20 20 20 20 20 20 2f 2a | 20 30 78 31 38 20 6d 61 | /*| 0x18 ma|
|00004fe0| 69 6e 20 32 35 36 6d 62 | 20 64 61 74 61 20 61 74 |in 256mb| data at|
|00004ff0| 20 30 78 30 30 30 30 30 | 30 20 2a 2f 0a 20 20 20 | 0x00000|0 */. |
|00005000| 20 20 20 20 20 2e 71 75 | 61 64 20 30 78 30 30 63 | .qu|ad 0x00c|
|00005010| 30 39 61 31 30 30 30 30 | 30 66 66 66 66 20 20 20 |09a10000|0ffff |
|00005020| 20 20 20 20 20 2f 2a 20 | 30 78 32 30 20 72 65 6c | /* |0x20 rel|
|00005030| 6f 20 32 35 36 6d 62 20 | 63 6f 64 65 20 61 74 20 |o 256mb |code at |
|00005040| 30 78 31 30 30 30 30 30 | 20 2a 2f 0a 20 20 20 20 |0x100000| */. |
|00005050| 20 20 20 20 2e 71 75 61 | 64 20 30 78 30 30 63 30 | .qua|d 0x00c0|
|00005060| 39 32 31 30 30 30 30 30 | 66 66 66 66 20 20 20 20 |92100000|ffff |
|00005070| 20 20 20 20 2f 2a 20 30 | 78 32 38 20 72 65 6c 6f | /* 0|x28 relo|
|00005080| 20 32 35 36 6d 62 20 64 | 61 74 61 20 61 74 20 30 | 256mb d|ata at 0|
|00005090| 78 31 30 30 30 30 30 20 | 2a 2f 0a 00 00 00 00 00 |x100000 |*/......|
|000050a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005100| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000051f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005200| 6d 65 6d 74 65 73 74 38 | 36 2f 6d 74 65 73 74 2e |memtest8|6/mtest.|
|00005210| 68 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |h.......|........|
|00005220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005260| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 32 30 32 |....1006|44 . 202|
|00005270| 35 32 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |52 . | 0 . |
|00005280| 20 20 20 31 37 35 32 20 | 20 36 31 35 32 37 35 34 | 1752 | 6152754|
|00005290| 37 37 32 20 20 31 32 37 | 31 36 00 20 30 00 00 00 |772 127|16. 0...|
|000052a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000052f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005300| 00 75 73 74 61 72 20 20 | 00 63 62 72 61 64 79 00 |.ustar |.cbrady.|
|00005310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005320| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00005330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000053f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005400| 2f 2a 20 6d 74 65 73 74 | 2e 68 20 2d 20 4d 65 6d |/* mtest|.h - Mem|
|00005410| 54 65 73 74 2d 38 36 20 | 64 65 66 69 6e 65 73 20 |Test-86 |defines |
|00005420| 2a 2f 0a 0a 2f 2a 20 43 | 6f 70 79 72 69 67 68 74 |*/../* C|opyright|
|00005430| 20 31 39 39 35 2c 20 20 | 43 68 72 69 73 20 42 72 | 1995, |Chris Br|
|00005440| 61 64 79 0a 20 2a 0a 20 | 2a 20 50 65 72 6d 69 73 |ady. *. |* Permis|
|00005450| 73 69 6f 6e 20 74 6f 20 | 75 73 65 2c 20 63 6f 70 |sion to |use, cop|
|00005460| 79 2c 20 6d 6f 64 69 66 | 79 2c 20 61 6e 64 20 64 |y, modif|y, and d|
|00005470| 69 73 74 72 69 62 75 74 | 65 20 74 68 69 73 0a 20 |istribut|e this. |
|00005480| 2a 20 73 6f 66 74 77 61 | 72 65 20 61 6e 64 20 69 |* softwa|re and i|
|00005490| 74 73 20 64 6f 63 75 6d | 65 6e 74 61 74 69 6f 6e |ts docum|entation|
|000054a0| 20 66 6f 72 20 61 6e 79 | 20 70 75 72 70 6f 73 65 | for any| purpose|
|000054b0| 20 61 6e 64 20 77 69 74 | 68 6f 75 74 20 66 65 65 | and wit|hout fee|
|000054c0| 0a 20 2a 20 69 73 20 67 | 72 61 6e 74 65 64 20 70 |. * is g|ranted p|
|000054d0| 72 6f 76 69 64 65 64 20 | 74 68 61 74 20 74 68 65 |rovided |that the|
|000054e0| 20 61 62 6f 76 65 20 63 | 6f 70 79 72 69 67 68 74 | above c|opyright|
|000054f0| 20 6e 6f 74 69 63 65 20 | 61 70 70 65 61 72 73 20 | notice |appears |
|00005500| 69 6e 20 61 6c 6c 20 63 | 6f 70 69 65 73 2e 0a 20 |in all c|opies.. |
|00005510| 2a 20 49 74 20 69 73 20 | 70 72 6f 76 69 64 65 64 |* It is |provided|
|00005520| 20 22 61 73 20 69 73 22 | 20 77 69 74 68 6f 75 74 | "as is"| without|
|00005530| 20 65 78 70 72 65 73 73 | 20 6f 72 20 69 6d 70 6c | express| or impl|
|00005540| 69 65 64 20 77 61 72 72 | 61 6e 74 79 2e 0a 20 2a |ied warr|anty.. *|
|00005550| 2f 20 0a 0a 23 64 65 66 | 69 6e 65 20 53 45 54 55 |/ ..#def|ine SETU|
|00005560| 50 53 45 43 53 09 31 09 | 09 2f 2a 20 4e 75 6d 62 |PSECS.1.|./* Numb|
|00005570| 65 72 20 6f 66 20 73 65 | 74 75 70 20 73 65 63 74 |er of se|tup sect|
|00005580| 6f 72 73 20 2a 2f 0a 23 | 64 65 66 69 6e 65 20 42 |ors */.#|define B|
|00005590| 4f 4f 54 53 45 47 09 09 | 30 78 30 37 63 30 09 09 |OOTSEG..|0x07c0..|
|000055a0| 2f 2a 20 53 65 67 6d 65 | 6e 74 20 61 64 72 73 20 |/* Segme|nt adrs |
|000055b0| 66 6f 72 20 69 6e 69 74 | 61 6c 20 62 6f 6f 74 20 |for init|al boot |
|000055c0| 2a 2f 0a 23 64 65 66 69 | 6e 65 20 49 4e 49 54 53 |*/.#defi|ne INITS|
|000055d0| 45 47 09 09 30 78 39 30 | 30 30 09 09 2f 2a 20 53 |EG..0x90|00../* S|
|000055e0| 65 67 6d 65 6e 74 20 61 | 64 72 73 20 66 6f 72 20 |egment a|drs for |
|000055f0| 72 65 6c 6f 63 61 74 65 | 64 20 62 6f 6f 74 20 2a |relocate|d boot *|
|00005600| 2f 0a 23 64 65 66 69 6e | 65 20 53 45 54 55 50 53 |/.#defin|e SETUPS|
|00005610| 45 47 09 49 4e 49 54 53 | 45 47 2b 30 78 32 30 09 |EG.INITS|EG+0x20.|
|00005620| 2f 2a 20 53 65 67 6d 65 | 6e 74 20 61 64 72 73 20 |/* Segme|nt adrs |
|00005630| 66 6f 72 20 72 65 6c 6f | 63 61 74 65 64 20 73 65 |for relo|cated se|
|00005640| 74 75 70 20 2a 2f 0a 23 | 64 65 66 69 6e 65 20 54 |tup */.#|define T|
|00005650| 53 54 4c 4f 41 44 09 09 | 30 78 31 30 30 30 09 09 |STLOAD..|0x1000..|
|00005660| 2f 2a 20 53 65 67 6d 65 | 6e 74 20 61 64 72 73 20 |/* Segme|nt adrs |
|00005670| 66 6f 72 20 6c 6f 61 64 | 20 6f 66 20 74 65 73 74 |for load| of test|
|00005680| 20 2a 2f 0a 23 64 65 66 | 69 6e 65 20 54 45 53 54 | */.#def|ine TEST|
|00005690| 41 44 52 09 09 30 78 30 | 31 30 30 09 09 2f 2a 20 |ADR..0x0|100../* |
|000056a0| 46 69 6e 61 6c 20 61 64 | 72 73 20 66 6f 72 20 74 |Final ad|rs for t|
|000056b0| 68 65 20 74 65 73 74 20 | 63 6f 64 65 20 2a 2f 0a |he test |code */.|
|000056c0| 23 64 65 66 69 6e 65 20 | 54 45 53 54 53 45 47 09 |#define |TESTSEG.|
|000056d0| 09 54 45 53 54 41 44 52 | 2f 30 78 31 30 09 2f 2a |.TESTADR|/0x10./*|
|000056e0| 20 46 69 6e 61 6c 20 73 | 65 67 6d 65 6e 74 20 61 | Final s|egment a|
|000056f0| 64 72 73 20 66 6f 72 20 | 74 65 73 74 20 63 6f 64 |drs for |test cod|
|00005700| 65 20 2a 2f 0a 23 64 65 | 66 69 6e 65 20 54 53 54 |e */.#de|fine TST|
|00005710| 53 49 5a 45 09 09 30 78 | 32 30 30 30 09 09 2f 2a |SIZE..0x|2000../*|
|00005720| 20 53 69 7a 65 20 6f 66 | 20 74 68 65 20 74 65 73 | Size of| the tes|
|00005730| 74 20 63 6f 64 65 20 2a | 2f 0a 23 64 65 66 69 6e |t code *|/.#defin|
|00005740| 65 20 4b 45 52 4e 45 4c | 5f 43 53 09 30 78 31 30 |e KERNEL|_CS.0x10|
|00005750| 09 09 2f 2a 20 33 32 20 | 62 69 74 20 73 65 67 6d |../* 32 |bit segm|
|00005760| 65 6e 74 20 61 64 72 73 | 20 66 6f 72 20 63 6f 64 |ent adrs| for cod|
|00005770| 65 20 2a 2f 0a 23 64 65 | 66 69 6e 65 20 4b 45 52 |e */.#de|fine KER|
|00005780| 4e 45 4c 5f 44 53 09 30 | 78 31 38 09 09 2f 2a 20 |NEL_DS.0|x18../* |
|00005790| 33 32 20 62 69 74 20 73 | 65 67 6d 65 6e 74 20 61 |32 bit s|egment a|
|000057a0| 64 72 73 20 66 6f 72 20 | 64 61 74 61 20 2a 2f 0a |drs for |data */.|
|000057b0| 23 64 65 66 69 6e 65 20 | 53 54 41 52 54 5f 41 44 |#define |START_AD|
|000057c0| 52 09 30 78 30 65 30 30 | 09 09 2f 2a 20 53 74 61 |R.0x0e00|../* Sta|
|000057d0| 72 74 69 6e 67 20 61 64 | 72 73 20 66 6f 72 20 74 |rting ad|rs for t|
|000057e0| 65 73 74 69 6e 67 20 2a | 2f 0a 00 00 00 00 00 00 |esting *|/.......|
|000057f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005800| 6d 65 6d 74 65 73 74 38 | 36 2f 73 65 74 75 70 2e |memtest8|6/setup.|
|00005810| 53 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |S.......|........|
|00005820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005860| 00 00 00 00 31 30 30 37 | 35 35 20 00 20 32 30 32 |....1007|55 . 202|
|00005870| 35 32 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 |52 . | 0 . |
|00005880| 20 20 20 36 30 30 36 20 | 20 36 31 35 32 37 34 36 | 6006 | 6152746|
|00005890| 35 36 33 20 20 31 32 36 | 37 34 00 20 30 00 00 00 |563 126|74. 0...|
|000058a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000058b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000058c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000058d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000058e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000058f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005900| 00 75 73 74 61 72 20 20 | 00 63 62 72 61 64 79 00 |.ustar |.cbrady.|
|00005910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005920| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00005930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005a00| 21 0a 21 20 73 65 74 75 | 70 2e 73 20 69 73 20 72 |!.! setu|p.s is r|
|00005a10| 65 73 70 6f 6e 73 69 62 | 6c 65 20 66 6f 72 20 67 |esponsib|le for g|
|00005a20| 65 74 74 69 6e 67 20 74 | 68 65 20 73 79 73 74 65 |etting t|he syste|
|00005a30| 6d 20 64 61 74 61 20 66 | 72 6f 6d 20 74 68 65 20 |m data f|rom the |
|00005a40| 42 49 4f 53 2c 0a 21 20 | 61 6e 64 20 70 75 74 74 |BIOS,.! |and putt|
|00005a50| 69 6e 67 20 74 68 65 6d | 20 69 6e 74 6f 20 74 68 |ing them| into th|
|00005a60| 65 20 61 70 70 72 6f 70 | 72 69 61 74 65 20 70 6c |e approp|riate pl|
|00005a70| 61 63 65 73 20 69 6e 20 | 73 79 73 74 65 6d 20 6d |aces in |system m|
|00005a80| 65 6d 6f 72 79 2e 0a 21 | 20 62 6f 74 68 20 73 65 |emory..!| both se|
|00005a90| 74 75 70 2e 73 20 61 6e | 64 20 73 79 73 74 65 6d |tup.s an|d system|
|00005aa0| 20 68 61 73 20 62 65 65 | 6e 20 6c 6f 61 64 65 64 | has bee|n loaded|
|00005ab0| 20 62 79 20 74 68 65 20 | 62 6f 6f 74 62 6c 6f 63 | by the |bootbloc|
|00005ac0| 6b 2e 0a 21 0a 21 20 31 | 2d 4a 61 6e 2d 39 36 20 |k..!.! 1|-Jan-96 |
|00005ad0| 4d 6f 64 69 66 69 65 64 | 20 62 79 20 43 68 72 69 |Modified| by Chri|
|00005ae0| 73 20 42 72 61 64 79 20 | 66 6f 72 20 75 73 65 20 |s Brady |for use |
|00005af0| 61 73 20 61 20 62 6f 6f | 74 2f 6c 6f 61 64 65 72 |as a boo|t/loader|
|00005b00| 20 66 6f 72 20 6d 65 6d | 74 65 73 74 2d 38 36 2e | for mem|test-86.|
|00005b10| 0a 0a 23 69 6e 63 6c 75 | 64 65 20 22 6d 74 65 73 |..#inclu|de "mtes|
|00005b20| 74 2e 68 22 0a 0a 2e 67 | 6c 6f 62 6c 20 62 65 67 |t.h"...g|lobl beg|
|00005b30| 74 65 78 74 2c 20 62 65 | 67 64 61 74 61 2c 20 62 |text, be|gdata, b|
|00005b40| 65 67 62 73 73 2c 20 65 | 6e 64 74 65 78 74 2c 20 |egbss, e|ndtext, |
|00005b50| 65 6e 64 64 61 74 61 2c | 20 65 6e 64 62 73 73 0a |enddata,| endbss.|
|00005b60| 2e 74 65 78 74 0a 62 65 | 67 74 65 78 74 3a 0a 2e |.text.be|gtext:..|
|00005b70| 64 61 74 61 0a 62 65 67 | 64 61 74 61 3a 0a 2e 62 |data.beg|data:..b|
|00005b80| 73 73 0a 62 65 67 62 73 | 73 3a 0a 2e 74 65 78 74 |ss.begbs|s:..text|
|00005b90| 0a 0a 65 6e 74 72 79 20 | 73 74 61 72 74 0a 73 74 |..entry |start.st|
|00005ba0| 61 72 74 3a 0a 0a 21 20 | 6f 6b 2c 20 74 68 65 20 |art:..! |ok, the |
|00005bb0| 72 65 61 64 20 77 65 6e | 74 20 77 65 6c 6c 20 73 |read wen|t well s|
|00005bc0| 6f 20 77 65 20 67 65 74 | 20 63 75 72 72 65 6e 74 |o we get| current|
|00005bd0| 20 63 75 72 73 6f 72 20 | 70 6f 73 69 74 69 6f 6e | cursor |position|
|00005be0| 20 61 6e 64 20 73 61 76 | 65 20 69 74 20 66 6f 72 | and sav|e it for|
|00005bf0| 0a 21 20 70 6f 73 74 65 | 72 69 74 79 2e 0a 0a 09 |.! poste|rity....|
|00005c00| 6d 6f 76 09 61 78 2c 23 | 49 4e 49 54 53 45 47 09 |mov.ax,#|INITSEG.|
|00005c10| 21 20 74 68 69 73 20 69 | 73 20 64 6f 6e 65 20 69 |! this i|s done i|
|00005c20| 6e 20 62 6f 6f 74 73 65 | 63 74 20 61 6c 72 65 61 |n bootse|ct alrea|
|00005c30| 64 79 2c 20 62 75 74 2e | 2e 2e 0a 09 6d 6f 76 09 |dy, but.|....mov.|
|00005c40| 64 73 2c 61 78 0a 0a 21 | 20 47 65 74 20 6d 65 6d |ds,ax..!| Get mem|
|00005c50| 6f 72 79 20 73 69 7a 65 | 20 28 65 78 74 65 6e 64 |ory size| (extend|
|00005c60| 65 64 20 6d 65 6d 2c 20 | 6b 42 29 0a 0a 20 20 20 |ed mem, |kB).. |
|00005c70| 20 20 20 20 20 6d 6f 76 | 20 20 20 20 20 61 68 2c | mov| ah,|
|00005c80| 23 30 78 38 38 0a 20 20 | 20 20 20 20 20 20 69 6e |#0x88. | in|
|00005c90| 74 20 20 20 20 20 30 78 | 31 35 0a 20 20 20 20 20 |t 0x|15. |
|00005ca0| 20 20 20 6d 6f 76 20 20 | 20 20 20 5b 30 5d 2c 61 | mov | [0],a|
|00005cb0| 78 0a 0a 21 20 6e 6f 77 | 20 77 65 20 77 61 6e 74 |x..! now| we want|
|00005cc0| 20 74 6f 20 6d 6f 76 65 | 20 74 6f 20 70 72 6f 74 | to move| to prot|
|00005cd0| 65 63 74 65 64 20 6d 6f | 64 65 20 2e 2e 2e 0a 0a |ected mo|de .....|
|00005ce0| 09 63 6c 69 09 09 09 21 | 20 6e 6f 20 69 6e 74 65 |.cli...!| no inte|
|00005cf0| 72 72 75 70 74 73 20 61 | 6c 6c 6f 77 65 64 20 21 |rrupts a|llowed !|
|00005d00| 0a 09 6d 6f 76 09 61 6c | 2c 23 30 78 38 30 09 21 |..mov.al|,#0x80.!|
|00005d10| 20 64 69 73 61 62 6c 65 | 20 4e 4d 49 20 66 6f 72 | disable| NMI for|
|00005d20| 20 74 68 65 20 62 6f 6f | 74 75 70 20 73 65 71 75 | the boo|tup sequ|
|00005d30| 65 6e 63 65 0a 09 6f 75 | 74 09 23 30 78 37 30 2c |ence..ou|t.#0x70,|
|00005d40| 61 6c 0a 0a 21 20 66 69 | 72 73 74 20 77 65 20 6d |al..! fi|rst we m|
|00005d50| 6f 76 65 20 74 68 65 20 | 73 79 73 74 65 6d 20 74 |ove the |system t|
|00005d60| 6f 20 69 74 73 20 72 69 | 67 68 74 66 75 6c 20 70 |o its ri|ghtful p|
|00005d70| 6c 61 63 65 0a 0a 09 6d | 6f 76 09 61 78 2c 23 54 |lace...m|ov.ax,#T|
|00005d80| 45 53 54 53 45 47 09 21 | 20 73 74 61 72 74 20 6f |ESTSEG.!| start o|
|00005d90| 66 20 64 65 73 74 69 6e | 61 74 69 6f 6e 20 73 65 |f destin|ation se|
|00005da0| 67 6d 65 6e 74 0a 09 6d | 6f 76 09 62 78 2c 23 54 |gment..m|ov.bx,#T|
|00005db0| 53 54 4c 4f 41 44 09 21 | 20 73 74 61 72 74 20 6f |STLOAD.!| start o|
|00005dc0| 66 20 73 6f 75 72 63 65 | 20 73 65 67 6d 65 6e 74 |f source| segment|
|00005dd0| 0a 09 63 6c 64 09 09 09 | 21 20 27 64 69 72 65 63 |..cld...|! 'direc|
|00005de0| 74 69 6f 6e 27 3d 30 2c | 20 6d 6f 76 73 20 6d 6f |tion'=0,| movs mo|
|00005df0| 76 65 73 20 66 6f 72 77 | 61 72 64 0a 64 6f 5f 6d |ves forw|ard.do_m|
|00005e00| 6f 76 65 3a 0a 09 6d 6f | 76 09 65 73 2c 61 78 09 |ove:..mo|v.es,ax.|
|00005e10| 09 21 20 64 65 73 74 69 | 6e 61 74 69 6f 6e 20 73 |.! desti|nation s|
|00005e20| 65 67 6d 65 6e 74 0a 09 | 61 64 64 09 61 78 2c 23 |egment..|add.ax,#|
|00005e30| 30 78 31 30 30 0a 09 63 | 6d 70 09 61 78 2c 23 54 |0x100..c|mp.ax,#T|
|00005e40| 45 53 54 53 45 47 2b 54 | 53 54 53 49 5a 45 0a 09 |ESTSEG+T|STSIZE..|
|00005e50| 6a 7a 09 65 6e 64 5f 6d | 6f 76 65 0a 09 6d 6f 76 |jz.end_m|ove..mov|
|00005e60| 09 64 73 2c 62 78 09 09 | 21 20 73 6f 75 72 63 65 |.ds,bx..|! source|
|00005e70| 20 73 65 67 6d 65 6e 74 | 0a 09 61 64 64 09 62 78 | segment|..add.bx|
|00005e80| 2c 23 30 78 31 30 30 0a | 09 73 75 62 09 64 69 2c |,#0x100.|.sub.di,|
|00005e90| 64 69 0a 09 73 75 62 09 | 73 69 2c 73 69 0a 09 6d |di..sub.|si,si..m|
|00005ea0| 6f 76 20 09 63 78 2c 23 | 30 78 38 30 30 0a 09 72 |ov .cx,#|0x800..r|
|00005eb0| 65 70 0a 09 6d 6f 76 73 | 77 0a 09 6a 6d 70 09 64 |ep..movs|w..jmp.d|
|00005ec0| 6f 5f 6d 6f 76 65 0a 0a | 21 20 74 68 65 6e 20 77 |o_move..|! then w|
|00005ed0| 65 20 6c 6f 61 64 20 74 | 68 65 20 73 65 67 6d 65 |e load t|he segme|
|00005ee0| 6e 74 20 64 65 73 63 72 | 69 70 74 6f 72 73 0a 0a |nt descr|iptors..|
|00005ef0| 65 6e 64 5f 6d 6f 76 65 | 3a 0a 09 70 75 73 68 09 |end_move|:..push.|
|00005f00| 63 73 0a 09 70 6f 70 09 | 64 73 0a 09 6c 69 64 74 |cs..pop.|ds..lidt|
|00005f10| 09 69 64 74 5f 34 38 09 | 09 21 20 6c 6f 61 64 20 |.idt_48.|.! load |
|00005f20| 69 64 74 20 77 69 74 68 | 20 30 2c 30 0a 09 6c 67 |idt with| 0,0..lg|
|00005f30| 64 74 09 67 64 74 5f 34 | 38 09 09 21 20 6c 6f 61 |dt.gdt_4|8..! loa|
|00005f40| 64 20 67 64 74 20 77 69 | 74 68 20 77 68 61 74 65 |d gdt wi|th whate|
|00005f50| 76 65 72 20 61 70 70 72 | 6f 70 72 69 61 74 65 0a |ver appr|opriate.|
|00005f60| 0a 21 20 74 68 61 74 20 | 77 61 73 20 70 61 69 6e |.! that |was pain|
|00005f70| 6c 65 73 73 2c 20 6e 6f | 77 20 77 65 20 65 6e 61 |less, no|w we ena|
|00005f80| 62 6c 65 20 41 32 30 0a | 0a 09 63 61 6c 6c 20 20 |ble A20.|..call |
|00005f90| 20 20 65 6d 70 74 79 5f | 38 30 34 32 0a 09 6d 6f | empty_|8042..mo|
|00005fa0| 76 09 61 6c 2c 23 30 78 | 44 31 09 09 21 20 63 6f |v.al,#0x|D1..! co|
|00005fb0| 6d 6d 61 6e 64 20 77 72 | 69 74 65 0a 09 6f 75 74 |mmand wr|ite..out|
|00005fc0| 09 23 30 78 36 34 2c 61 | 6c 0a 09 63 61 6c 6c 20 |.#0x64,a|l..call |
|00005fd0| 20 20 20 65 6d 70 74 79 | 5f 38 30 34 32 0a 09 6d | empty|_8042..m|
|00005fe0| 6f 76 09 61 6c 2c 23 30 | 78 44 46 09 09 21 20 41 |ov.al,#0|xDF..! A|
|00005ff0| 32 30 20 6f 6e 0a 09 6f | 75 74 09 23 30 78 36 30 |20 on..o|ut.#0x60|
|00006000| 2c 61 6c 0a 09 63 61 6c | 6c 20 20 20 20 65 6d 70 |,al..cal|l emp|
|00006010| 74 79 5f 38 30 34 32 0a | 0a 21 20 4e 6f 74 65 20 |ty_8042.|.! Note |
|00006020| 74 68 61 74 20 74 68 65 | 20 73 68 6f 72 74 20 6a |that the| short j|
|00006030| 75 6d 70 20 69 73 6e 27 | 74 20 73 74 72 69 63 74 |ump isn'|t strict|
|00006040| 6c 79 20 6e 65 65 64 65 | 64 2c 20 61 6c 74 68 6f |ly neede|d, altho|
|00006050| 75 67 68 74 20 74 68 65 | 72 65 20 61 72 65 0a 21 |ught the|re are.!|
|00006060| 20 72 65 61 73 6f 6e 73 | 20 77 68 79 20 69 74 20 | reasons| why it |
|00006070| 6d 69 67 68 74 20 62 65 | 20 61 20 67 6f 6f 64 20 |might be| a good |
|00006080| 69 64 65 61 2e 20 49 74 | 20 77 6f 6e 27 74 20 68 |idea. It| won't h|
|00006090| 75 72 74 20 69 6e 20 61 | 6e 79 20 63 61 73 65 2e |urt in a|ny case.|
|000060a0| 0a 21 0a 09 6d 6f 76 09 | 61 78 2c 23 30 78 30 30 |.!..mov.|ax,#0x00|
|000060b0| 30 31 09 21 20 70 72 6f | 74 65 63 74 65 64 20 6d |01.! pro|tected m|
|000060c0| 6f 64 65 20 28 50 45 29 | 20 62 69 74 0a 09 6c 6d |ode (PE)| bit..lm|
|000060d0| 73 77 09 61 78 09 09 21 | 20 54 68 69 73 20 69 73 |sw.ax..!| This is|
|000060e0| 20 69 74 21 0a 09 6a 6d | 70 09 66 6c 75 73 68 5f | it!..jm|p.flush_|
|000060f0| 69 6e 73 74 72 0a 66 6c | 75 73 68 5f 69 6e 73 74 |instr.fl|ush_inst|
|00006100| 72 3a 0a 09 6d 6f 76 09 | 61 78 2c 23 4b 45 52 4e |r:..mov.|ax,#KERN|
|00006110| 45 4c 5f 44 53 0a 09 6d | 6f 76 09 64 73 2c 61 78 |EL_DS..m|ov.ds,ax|
|00006120| 0a 09 6d 6f 76 09 73 73 | 2c 61 78 0a 09 6d 6f 76 |..mov.ss|,ax..mov|
|00006130| 09 61 78 2c 23 30 78 30 | 37 32 30 0a 09 6d 6f 76 |.ax,#0x0|720..mov|
|00006140| 09 65 62 78 2c 23 30 78 | 62 38 30 30 30 0a 09 6d |.ebx,#0x|b8000..m|
|00006150| 6f 76 09 65 63 78 2c 23 | 30 78 63 30 30 30 30 0a |ov.ecx,#|0xc0000.|
|00006160| 63 6c 72 6c 70 3a 0a 09 | 6d 6f 76 09 28 65 62 78 |clrlp:..|mov.(ebx|
|00006170| 29 2c 61 78 0a 09 69 6e | 63 09 65 62 78 0a 09 69 |),ax..in|c.ebx..i|
|00006180| 6e 63 09 65 62 78 0a 09 | 63 6d 70 09 65 62 78 2c |nc.ebx..|cmp.ebx,|
|00006190| 65 63 78 0a 09 6a 6e 7a | 09 63 6c 72 6c 70 0a 0a |ecx..jnz|.clrlp..|
|000061a0| 09 6a 6d 70 69 09 54 45 | 53 54 41 44 52 2c 4b 45 |.jmpi.TE|STADR,KE|
|000061b0| 52 4e 45 4c 5f 43 53 09 | 21 20 6a 6d 70 20 6f 66 |RNEL_CS.|! jmp of|
|000061c0| 66 73 65 74 20 32 30 30 | 30 20 6f 66 20 73 65 67 |fset 200|0 of seg|
|000061d0| 6d 65 6e 74 20 30 78 31 | 30 20 28 63 73 29 0a 0a |ment 0x1|0 (cs)..|
|000061e0| 21 20 54 68 69 73 20 72 | 6f 75 74 69 6e 65 20 63 |! This r|outine c|
|000061f0| 68 65 63 6b 73 20 74 68 | 61 74 20 74 68 65 20 6b |hecks th|at the k|
|00006200| 65 79 62 6f 61 72 64 20 | 63 6f 6d 6d 61 6e 64 20 |eyboard |command |
|00006210| 71 75 65 75 65 20 69 73 | 20 65 6d 70 74 79 0a 21 |queue is| empty.!|
|00006220| 20 28 61 66 74 65 72 20 | 65 6d 70 74 79 69 6e 67 | (after |emptying|
|00006230| 20 74 68 65 20 6f 75 74 | 70 75 74 20 62 75 66 66 | the out|put buff|
|00006240| 65 72 73 29 0a 21 0a 21 | 20 4e 6f 20 74 69 6d 65 |ers).!.!| No time|
|00006250| 6f 75 74 20 69 73 20 75 | 73 65 64 20 2d 20 69 66 |out is u|sed - if|
|00006260| 20 74 68 69 73 20 68 61 | 6e 67 73 20 74 68 65 72 | this ha|ngs ther|
|00006270| 65 20 69 73 20 73 6f 6d | 65 74 68 69 6e 67 20 77 |e is som|ething w|
|00006280| 72 6f 6e 67 20 77 69 74 | 68 0a 21 20 74 68 65 20 |rong wit|h.! the |
|00006290| 6d 61 63 68 69 6e 65 2c | 20 61 6e 64 20 77 65 20 |machine,| and we |
|000062a0| 70 72 6f 62 61 62 6c 79 | 20 63 6f 75 6c 64 6e 27 |probably| couldn'|
|000062b0| 74 20 70 72 6f 63 65 65 | 64 20 61 6e 79 77 61 79 |t procee|d anyway|
|000062c0| 2e 0a 65 6d 70 74 79 5f | 38 30 34 32 3a 0a 09 63 |..empty_|8042:..c|
|000062d0| 61 6c 6c 09 64 65 6c 61 | 79 0a 09 69 6e 09 61 6c |all.dela|y..in.al|
|000062e0| 2c 23 30 78 36 34 09 21 | 20 38 30 34 32 20 73 74 |,#0x64.!| 8042 st|
|000062f0| 61 74 75 73 20 70 6f 72 | 74 0a 09 74 65 73 74 09 |atus por|t..test.|
|00006300| 61 6c 2c 23 31 09 09 21 | 20 6f 75 74 70 75 74 20 |al,#1..!| output |
|00006310| 62 75 66 66 65 72 3f 0a | 09 6a 7a 09 6e 6f 5f 6f |buffer?.|.jz.no_o|
|00006320| 75 74 70 75 74 0a 09 63 | 61 6c 6c 09 64 65 6c 61 |utput..c|all.dela|
|00006330| 79 0a 09 69 6e 09 61 6c | 2c 23 30 78 36 30 09 21 |y..in.al|,#0x60.!|
|00006340| 20 72 65 61 64 20 69 74 | 0a 09 6a 6d 70 09 65 6d | read it|..jmp.em|
|00006350| 70 74 79 5f 38 30 34 32 | 0a 6e 6f 5f 6f 75 74 70 |pty_8042|.no_outp|
|00006360| 75 74 3a 0a 09 74 65 73 | 74 09 61 6c 2c 23 32 09 |ut:..tes|t.al,#2.|
|00006370| 09 21 20 69 73 20 69 6e | 70 75 74 20 62 75 66 66 |.! is in|put buff|
|00006380| 65 72 20 66 75 6c 6c 3f | 0a 09 6a 6e 7a 09 65 6d |er full?|..jnz.em|
|00006390| 70 74 79 5f 38 30 34 32 | 09 21 20 79 65 73 20 2d |pty_8042|.! yes -|
|000063a0| 20 6c 6f 6f 70 0a 09 72 | 65 74 0a 21 0a 21 20 44 | loop..r|et.!.! D|
|000063b0| 65 6c 61 79 20 69 73 20 | 6e 65 65 64 65 64 20 61 |elay is |needed a|
|000063c0| 66 74 65 72 20 64 6f 69 | 6e 67 20 69 2f 6f 0a 21 |fter doi|ng i/o.!|
|000063d0| 0a 64 65 6c 61 79 3a 0a | 09 2e 77 6f 72 64 09 30 |.delay:.|..word.0|
|000063e0| 78 30 30 65 62 09 09 09 | 21 20 6a 6d 70 20 24 2b |x00eb...|! jmp $+|
|000063f0| 32 0a 09 72 65 74 0a 0a | 67 64 74 3a 0a 09 2e 77 |2..ret..|gdt:...w|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.